June 26, 2014 · 8:00 PM
Binary Kitchen e.V.
Lenses are an abstraction that allows you to easily access and modify parts of a potentially large data structure. The typical motivating example are lenses for fields of records. However, lenses can be composed, allowing for quick access deep into a nested structure, and also generalized in other ways, making them potentially a beautiful solution for a whole lot of programming problems.
I'm going to give a short introduction to classic lenses and their laws. Depending on what everyone is interested in, I'll then go on to look a bit at their implementation (there are several ways to represent a lens internally, some very straight-forward, others quite clever) and various forms of generalizations (such as lifting lenses into monads, or potentially traversals and prisms).