History of Lenses

Edward Kmett edited this page Aug 8, 2015 · 5 revisions

lens didn't just come out of the aether fully formed, it was a result of many people having many ideas over a long time. Here are a few of the revelations, reading about them may help understand the ideas and concerns of the library.

Jeremy Gibbons and Bruno C. d. S. Oliveira demonstrate that Traversals encode the Iterator pattern

The Essence of the Iterator Pattern

Luke Palmer creates a pattern he calls Accessors to ease stateful programming in Haskell

(wayback)Making Haskell nicer for game programming

Luke Palmer refines the notion of Accessors into something more like lenses

(wayback)Haskell State Accessors (second attempt: Composability)

Twan van Laarhoven comes up with a novel way to express lenses

CPS based functional references

Russell O'Connor realises such lenses can support polymorphic update and noticed that they relate to his concept of a multilens (a concept which is now called a "traversal") if you vary the constraints

Polymorphic Update with van Laarhoven Lenses

Edward Kmett realises that you can put laws on the notion of polymorphic update

Mirrored Lenses