Closed zrho closed 8 years ago
Oh, it appears that pull requests also automatically include commits that have been added later. So this also includes re
, which gives you the inverse of an Iso
or a Prism
. For that I had to change Getter
s to use (the isomorphic profunctor) Forget r
instead of Star (Const r)
, since the first can cleanly be given a Cochoice
instance in a strict language.
Great stuff, thanks!
One very useful thing about lenses is how they can be used in combination with state monads; this allows seemingly imperative programming on the state encapsulated by the monad. To make this happen, I added a few combinators for
Setter
s andGetter
s and the ability tozoom
into aStateT
.