Get the latest tech news
Lens: Lenses, Folds and Traversals
Lenses, Folds and Traversals
The combinators in Control.Lens provide a highly generic toolbox for composing families of getters, folds, isomorphisms, traversals, setters and lenses and their indexed variants. What is provided in this library is a number of stock lenses and traversals for common haskell types, a wide array of combinators for working them, and more exotic functionality, ( e.g. getters, setters, indexed folds, isomorphisms). Combinators are included that are based on Neil Mitchell's uniplate, but which have been generalized to work on or as lenses, folds, and traversals.
Or read this on Hacker News