Overview · ekmett/lens Wiki
github.com · 571 words · saved by 2 readers
Lenses, Folds, and Traversals - Join us on web.libera.chat #haskell-lens - ekmett/lens
What are Lenses? Lenses are composable functional references. They allow you to access and modify data potentially very deep within a structure! Ignoring the implementation for the moment, lenses provide us with two operations: view :: Lens' a b -> a -> b set :: Lens' a b -> b -> a -> a So we can view a lens as a pair of a getter and a setter that are in some sense compatible. We'll use the following lenses to start off: _1 :: Lens' (a,b) a _2 :: Lens' (a,b) b to both read from >>> view _2 ("hello","world") ("world") and write to parts of a whole: >>> set _2 42 ("hello",0)…
saved by
related reading
- The Mondrian introduction to functional opticsmarcosh.github.io
- Bireactive Programmingorionreed.github.io
- Operators and Values — Learn TLA+learntla.com
- Project Cambria: Translate your data with lensesinkandswitch.com
- Cameras and Lenses – Bartosz Ciechanowskiciechanow.ski
- 4. Sets and Functions - Mathematics in Lean v4.19.0 documentationleanprover-community.github.io
- A Lean Syntax Primer — overreactedoverreacted.io
- Semantic Domain: The Geometry of Interaction, as an OCaml programsemantic-domain.blogspot.com
- Bartosz Milewski's Programming Cafe | Category Theory, Haskell, Concurrency, C++bartoszmilewski.com
- What is a Monad?lukechampine.com
- CSC 151 - Higher-order design, recursive and othereikmeier.sites.grinnell.edu
- Starting Out - Learn You a Haskell for Great Good!learnyouahaskell.github.io