Pure profunctor lenses: a mechanism for updating, viewing, and setting values within nested data structures.
Learn more about profunctor lenses with:
Install profunctor-lenses
with Spago:
spago install profunctor-lenses
> structure = Tuple (Tuple (Tuple "hi!" 3) 2) 1
> import Data.Lens
> _leftmost = _1 <<< _1 <<< _1
> view _leftmost structure
"hi!"
> set _leftmost "Bye!" structure
(Tuple (Tuple (Tuple "Bye!" 3) 2) 1)
> over _leftmost String.toUpper structure
(Tuple (Tuple (Tuple "HI!" 3) 2) 1)
You can try out the examples in the REPL by running:
spago -x examples.dhall repl
profunctor-lenses
documentation is stored in a few places:
examples
directory.If you get stuck, there are several ways to get help:
You can contribute to profunctor-lenses
in several ways:
If you encounter a problem or have a question, please open an issue. We'll do our best to work with you to resolve or answer it.
If you would like to contribute code, tests, or documentation, please read the contributor guide. It's a short, helpful introduction to contributing to this library, including development instructions.
If you have written a library, tutorial, guide, or other resource based on this package, please share it on the PureScript Discourse! Writing libraries and learning resources are a great way to help this library succeed.