Package

profunctor-lenses

Repository
purerl/purescript-profunctor-lenses
Uploaded by
nwolverson

CI Release Pursuit Maintainer: garyb Maintainer: thomashoneyman

Pure profunctor lenses: a mechanism for updating, viewing, and setting values within nested data structures.

Learn more about profunctor lenses with:

Installation

Install profunctor-lenses with Spago:

spago install profunctor-lenses

Quick start

> 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

Documentation

profunctor-lenses documentation is stored in a few places:

  1. Module documentation is published on Pursuit.
  2. Usage examples can be found in the test suite and examples directory.
  3. Practical Profunctor Optics & Lenses in PureScript, a practical introduction to profunctor optics in PureScript
  4. Lenses for the Mere Mortal, a book about lenses in PureScript

If you get stuck, there are several ways to get help:

Contributing

You can contribute to profunctor-lenses in several ways:

  1. 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.

  2. 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.

  3. 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.

Modules
Data.Lens
Data.Lens.AffineTraversal
Data.Lens.At
Data.Lens.Common
Data.Lens.Fold
Data.Lens.Fold.Partial
Data.Lens.Getter
Data.Lens.Grate
Data.Lens.Index
Data.Lens.Indexed
Data.Lens.Internal.Bazaar
Data.Lens.Internal.Exchange
Data.Lens.Internal.Focusing
Data.Lens.Internal.Forget
Data.Lens.Internal.Grating
Data.Lens.Internal.Indexed
Data.Lens.Internal.Market
Data.Lens.Internal.Re
Data.Lens.Internal.Shop
Data.Lens.Internal.Stall
Data.Lens.Internal.Tagged
Data.Lens.Internal.Wander
Data.Lens.Internal.Zipping
Data.Lens.Iso
Data.Lens.Iso.Newtype
Data.Lens.Lens
Data.Lens.Lens.Product
Data.Lens.Lens.Tuple
Data.Lens.Lens.Unit
Data.Lens.Lens.Void
Data.Lens.Prism
Data.Lens.Prism.Coproduct
Data.Lens.Prism.Either
Data.Lens.Prism.Maybe
Data.Lens.Record
Data.Lens.Setter
Data.Lens.Traversal
Data.Lens.Types
Data.Lens.Zoom
Dependencies