Decode a value at the current location.
Decode a value at the current location.
Note that this operation is not lawful, since decoding is not injective (as noted by Julien Truffaut). It is provided here for convenience, but may change in future versions.
Select if a value matches a predicate
Select if a value matches a predicate
Note that this operation is not lawful because the predicate could be invalidated with set or modify.
However select(_.a > 10) composeLens b
is safe because once we zoom into b
, we cannot change a
anymore.