Could someone explain functional lenses to me? It’s a surprisingly difficult subject to google for and I haven’t made any progress. All I know is that they provide similar get/set functionality than in OO.
Could someone explain functional lenses to me? It’s a surprisingly difficult subject to google
Share
A lens consists of two functions, a getter and a setter:
For example, we might have lenses for the first and second parts of a pair:
The real convenience of lenses is that they compose:
And they mechanically convert to
Statetransitions: