@@ -128,6 +128,9 @@ public static <K, V> Lens.Simple<Map<K, V>, Collection<V>> values() {
128
128
/**
129
129
* A lens that focuses on the inverse of a map (keys and values swapped). In the case of multiple equal values
130
130
* becoming keys, the last one wins.
131
+ * <p>
132
+ * Note that this lens is very likely to NOT be lawful, since "you get back what you put in" will fail for any keys
133
+ * that map to the same value.
131
134
*
132
135
* @param <K> the key type
133
136
* @param <V> the value type
@@ -149,9 +152,11 @@ public static <K, V> Lens.Simple<Map<K, V>, Map<V, K>> inverted() {
149
152
/**
150
153
* A lens that focuses on a map while mapping its values with the mapping function.
151
154
* <p>
152
- * Note that this lens is NOT lawful, since "you get back what you put in" fails for all values <code>B</code> that
153
- * do not map from the current values in <code>S</code> (new mappings cannot be preserved as the inversion of
154
- * <code>fn</code> is not known).
155
+ * Note that this lens is very likely to NOT be lawful, since "you get back what you put in" will fail for all
156
+ * values <code>B</code> that do not map from the current values in <code>S</code> (new mappings cannot be
157
+ * preserved as the inversion of <code>fn</code> is not known). Furthermore, if <code>fn</code> is injective
158
+ * (multiple <code>V</code>s map to the same <code>V2</code>), this lens will also not be lawful for similar reasons
159
+ * as stated above.
155
160
*
156
161
* @param fn the mapping function
157
162
* @param <K> the key type
@@ -183,7 +188,7 @@ public static <K, V, V2> Lens.Simple<Map<K, V>, Map<K, V2>> mappingValues(Functi
183
188
* @param iso the mapping {@link Iso}
184
189
* @param <K> the key type
185
190
* @param <V> the unfocused map value type
186
- * @param <V2> the focused map value types
191
+ * @param <V2> the focused map value type
187
192
* @return a lens that focuses on a map while mapping its values
188
193
*/
189
194
public static <K , V , V2 > Lens .Simple <Map <K , V >, Map <K , V2 >> mappingValues (Iso <V , V , V2 , V2 > iso ) {
0 commit comments