Lens provides access (read, write, modify, fold, travers) into the middle of a data structure, or container
A Lens is also a first-class value with a type
Lens' s a
where s
is the container type and a
is the focus type
For example Lens' DateTime Mins
, Lens' DateTime Hours
(remark: isn’t this just the comonad? oh not completely, a comonad would need to be a pair of data and a lense (the focus))
Lenses compose
composeL :: Lens' s1 s2 -> Lens' s2 a -> Lens' s1 a