lens-4.2: Lenses, Folds and Traversals

Copyright(C) 2012-14 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
PortabilityRank2Types
Safe HaskellSafe-Inferred
LanguageHaskell98

Control.Lens.Reified

Description

 

Synopsis

Documentation

>>> import Control.Lens

newtype ReifiedLens s t a b Source

Reify a Lens so it can be stored safely in a container.

Constructors

Lens 

Fields

runLens :: Lens s t a b
 

newtype ReifiedIndexedLens i s t a b Source

Reify an IndexedLens so it can be stored safely in a container.

Constructors

IndexedLens 

Fields

runIndexedLens :: IndexedLens i s t a b
 

newtype ReifiedIndexedTraversal i s t a b Source

Reify an IndexedTraversal so it can be stored safely in a container.

Constructors

IndexedTraversal 

newtype ReifiedTraversal s t a b Source

A form of Traversal that can be stored monomorphically in a container.

Constructors

Traversal 

Fields

runTraversal :: Traversal s t a b
 

newtype ReifiedGetter s a Source

Reify a Getter so it can be stored safely in a container.

This can also be useful when combining getters in novel ways, as ReifiedGetter is isomorphic to '(->)' and provides similar instances.

>>> ("hello","world","!!!")^.runGetter ((,) <$> Getter _2 <*> Getter (_1.to length))
("world",5)

Constructors

Getter 

Fields

runGetter :: Getter s a
 

newtype ReifiedFold s a Source

Reify a Fold so it can be stored safely in a container.

This can also be useful for creatively combining folds as ReifiedFold s is isomorphic to ReaderT s [] and provides similar instances.

>>> ("hello","world")^..runFold ((,) <$> Fold _2 <*> Fold both)
[("world","hello"),("world","world")]

Constructors

Fold 

Fields

runFold :: Fold s a
 

newtype ReifiedSetter s t a b Source

Reify a Setter so it can be stored safely in a container.

Constructors

Setter 

Fields

runSetter :: Setter s t a b
 

newtype ReifiedIndexedSetter i s t a b Source

Reify an IndexedSetter so it can be stored safely in a container.

Constructors

IndexedSetter 

Fields

runIndexedSetter :: IndexedSetter i s t a b
 

newtype ReifiedIso s t a b Source

Reify an Iso so it can be stored safely in a container.

Constructors

Iso 

Fields

runIso :: Iso s t a b
 

newtype ReifiedPrism s t a b Source

Reify a Prism so it can be stored safely in a container.

Constructors

Prism 

Fields

runPrism :: Prism s t a b