Profunctor optic.
Modulelens-5.3.6Haskell2010
Control.Lens.Profunctor
This module provides conversion functions between the optics defined in this library and Profunctor-based optics.
The goal of these functions is to provide an interoperability layer between the two styles of optics, and not to reimplement all the library in terms of Profunctor optics.
Synopsis
- type OpticP
- value fromLens
- value fromIso
- value fromPrism
- value fromSetter
- value fromTraversal
- value toLens
- value toIso
- value toPrism
- value toSetter
- value toTraversal
- Packagelens-5.3.6
- Exports11
- LanguageHaskell2010
- LicenceBSD-2-Clause
- SourceProfunctor.hs
Profunctor optic
Conversion from Van Laarhoven optics
Converts a Lens to a Profunctor-based one.
fromLens :: Lens s t a b -> LensP s t a b
Converts a Iso to a Profunctor-based one.
fromIso :: Iso s t a b -> IsoP s t a b
Converts a Prism to a Profunctor-based one.
fromPrism :: Prism s t a b -> PrismP s t a b
Converts a Setter to a Profunctor-based one.
fromSetter :: Setter s t a b -> SetterP s t a b
Converts a Traversal to a Profunctor-based one.
fromTraversal :: Traversal s t a b -> TraversalP s t a b
Conversion to Van Laarhoven optics
Obtain a Lens from a Profunctor-based one.
toLens :: LensP s t a b -> Lens s t a b
Obtain a Iso from a Profunctor-based one.
toIso :: IsoP s t a b -> Iso s t a b
Obtain a Prism from a Profunctor-based one.
toPrism :: PrismP s t a b -> Prism s t a b
Obtain a Setter from a Profunctor-based one.
toSetter :: SetterP s t a b -> Setter s t a b
Obtain a Traversal from a Profunctor-based one.
toTraversal :: TraversalP s t a b -> Traversal s t a b