Functional lenses
A lens consists of two functions, a getter and a setter: data Lens a b = Lens { getter :: a -> b, setter :: b -> a -> a } For example, we might have lenses for the first and second parts of a pair: fstLens :: Lens (a, b) a fstLens = Lens … Read more