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
- Project Cambria: Translate your data with lensesinkandswitch.com
- Cameras and Lenses – Bartosz Ciechanowskiciechanow.ski
- Bidirectional transformation - Wikipediaen.wikipedia.org
- Structure and Interpretation of Computer Programsmitp-content-server.mit.edu
- 4. Sets and Functions - Mathematics in Lean v4.19.0 documentationleanprover-community.github.io
- Understanding the J-Lensemma-x1.github.io
- combinators in Rubymooreniemi.github.io
- adventures in uncertainty: An Introduction to Recursion Schemesblog.sumtypeofway.com
- Typeclassopedia - HaskellWikiwiki.haskell.org
- CSC 151 - Anonymous procedureseikmeier.sites.grinnell.edu