Maybe
s, and so on. They compose nicely, so you can all kinds of mutable-feeling updates in a totally controlled way.^
.
go deeper / compose (normal composition operator)^.
get / lookup^?
get nullable field (see Nullable
below)~
&
mutate with / and also (it's the normal pipe / reverse application operator).~
set / replace?~
set a nullable field (see Nullable
below)%~
update with a function (run function on current value and set it to that)+~
add to the current value (e.g. counter)-~
subtract from current value*~
multiple current value by?
^?
get inside a Maybe
(i.e. stop lensing if it's a Nothing
)?~
set a nullable field (i.e. .~ Just newValue
).
) or with a named lens that is a composition of others.owner :: Person
: