Control.Lens.Reified

lens-4.13.2.1: Lenses, Folds and Traversals

Copyright | (C) 2012-16 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | Rank2Types
Safe Haskell | None
Language | Haskell98

Control.Lens.Reified

Description

Synopsis

- newtype ReifiedLens s t a b = Lens {
  - runLens :: Lens s t a b
  }
- type ReifiedLens' s a = ReifiedLens s s a a
- newtype ReifiedIndexedLens i s t a b = IndexedLens {
  - runIndexedLens :: IndexedLens i s t a b
  }
- type ReifiedIndexedLens' i s a = ReifiedIndexedLens i s s a a
- newtype ReifiedIndexedTraversal i s t a b = IndexedTraversal {
  - runIndexedTraversal :: IndexedTraversal i s t a b
  }
- type ReifiedIndexedTraversal' i s a = ReifiedIndexedTraversal i s s a a
- newtype ReifiedTraversal s t a b = Traversal {
  - runTraversal :: Traversal s t a b
  }
- type ReifiedTraversal' s a = ReifiedTraversal s s a a
- newtype ReifiedGetter s a = Getter {
  - runGetter :: Getter s a
  }
- newtype ReifiedIndexedGetter i s a = IndexedGetter {
  - runIndexedGetter :: IndexedGetter i s a
  }
- newtype ReifiedFold s a = Fold {
  - runFold :: Fold s a
  }
- newtype ReifiedIndexedFold i s a = IndexedFold {
  - runIndexedFold :: IndexedFold i s a
  }
- newtype ReifiedSetter s t a b = Setter {
  - runSetter :: Setter s t a b
  }
- type ReifiedSetter' s a = ReifiedSetter s s a a
- newtype ReifiedIndexedSetter i s t a b = IndexedSetter {
  - runIndexedSetter :: IndexedSetter i s t a b
  }
- type ReifiedIndexedSetter' i s a = ReifiedIndexedSetter i s s a a
- newtype ReifiedIso s t a b = Iso {
  - runIso :: Iso s t a b
  }
- type ReifiedIso' s a = ReifiedIso s s a a
- newtype ReifiedPrism s t a b = Prism {
  - runPrism :: Prism s t a b
  }
- type ReifiedPrism' s a = ReifiedPrism s s a a

# Documentation

    >>> import Control.Lens

newtype ReifiedLens s t a b

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

Constructors

Lens |
Fields runLens :: Lens s t a b

type ReifiedLens' s a = ReifiedLens s s a a

    type ReifiedLens' = Simple ReifiedLens

newtype ReifiedIndexedLens i s t a b

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

Constructors

IndexedLens |
Fields runIndexedLens :: IndexedLens i s t a b

type ReifiedIndexedLens' i s a = ReifiedIndexedLens i s s a a

    type ReifiedIndexedLens' i = Simple (ReifiedIndexedLens i)

newtype ReifiedIndexedTraversal i s t a b

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

Constructors

IndexedTraversal |
Fields runIndexedTraversal :: IndexedTraversal i s t a b

type ReifiedIndexedTraversal' i s a = ReifiedIndexedTraversal i s s a a

    type ReifiedIndexedTraversal' i = Simple (ReifiedIndexedTraversal i)

newtype ReifiedTraversal s t a b

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

Constructors

Traversal |
Fields runTraversal :: Traversal s t a b

type ReifiedTraversal' s a = ReifiedTraversal s s a a

    type ReifiedTraversal' = Simple ReifiedTraversal

newtype ReifiedGetter s a

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

Instances

Arrow ReifiedGetter |
ArrowChoice ReifiedGetter |
ArrowApply ReifiedGetter |
ArrowLoop ReifiedGetter |
Representable ReifiedGetter |
Corepresentable ReifiedGetter |
Choice ReifiedGetter |
Closed ReifiedGetter |
Strong ReifiedGetter |
Costrong ReifiedGetter |
Profunctor ReifiedGetter |
Conjoined ReifiedGetter |
Category * ReifiedGetter |
Sieve ReifiedGetter Identity |
Cosieve ReifiedGetter Identity |
MonadReader s (ReifiedGetter s) |
Monad (ReifiedGetter s) |
Functor (ReifiedGetter s) |
Applicative (ReifiedGetter s) |
Distributive (ReifiedGetter s) |
Monoid s => Comonad (ReifiedGetter s) |
Monoid s => ComonadApply (ReifiedGetter s) |
Apply (ReifiedGetter s) |
Bind (ReifiedGetter s) |
Semigroup s => Extend (ReifiedGetter s) |
type Rep ReifiedGetter = Identity |
type Corep ReifiedGetter = Identity |

newtype ReifiedIndexedGetter i s a

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

Constructors

IndexedGetter |
Fields runIndexedGetter :: IndexedGetter i s a

Instances

Representable (ReifiedIndexedGetter i) |
Strong (ReifiedIndexedGetter i) |
Profunctor (ReifiedIndexedGetter i) |
Sieve (ReifiedIndexedGetter i) ((,) i) |
Functor (ReifiedIndexedGetter i s) |
Semigroup i => Apply (ReifiedIndexedGetter i s) |
type Rep (ReifiedIndexedGetter i) = (,) i |

newtype ReifiedFold s a

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

Instances

Arrow ReifiedFold |
ArrowChoice ReifiedFold |
ArrowApply ReifiedFold |
Representable ReifiedFold |
Choice ReifiedFold |
Strong ReifiedFold |
Profunctor ReifiedFold |
Category * ReifiedFold |
Sieve ReifiedFold [] |
MonadReader s (ReifiedFold s) |
Monad (ReifiedFold s) |
Functor (ReifiedFold s) |
Applicative (ReifiedFold s) |
Alternative (ReifiedFold s) |
MonadPlus (ReifiedFold s) |
Plus (ReifiedFold s) |
Alt (ReifiedFold s) |
Apply (ReifiedFold s) |
Bind (ReifiedFold s) |
Monoid (ReifiedFold s a) |
Semigroup (ReifiedFold s a) |
type Rep ReifiedFold = [] |

newtype ReifiedIndexedFold i s a

Constructors

IndexedFold |
Fields runIndexedFold :: IndexedFold i s a

Instances

Representable (ReifiedIndexedFold i) |
Strong (ReifiedIndexedFold i) |
Profunctor (ReifiedIndexedFold i) |
Sieve (ReifiedIndexedFold i) (Compose [] ((,) i)) |
Functor (ReifiedIndexedFold i s) |
Plus (ReifiedIndexedFold i s) |
Alt (ReifiedIndexedFold i s) |
Monoid (ReifiedIndexedFold i s a) |
Semigroup (ReifiedIndexedFold i s a) |
type Rep (ReifiedIndexedFold i) = Compose [] ((,) i) |

newtype ReifiedSetter s t a b

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

Constructors

Setter |
Fields runSetter :: Setter s t a b

type ReifiedSetter' s a = ReifiedSetter s s a a

    type ReifiedSetter' = Simple ReifiedSetter

newtype ReifiedIndexedSetter i s t a b

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

Constructors

IndexedSetter |
Fields runIndexedSetter :: IndexedSetter i s t a b

type ReifiedIndexedSetter' i s a = ReifiedIndexedSetter i s s a a

    type ReifiedIndexedSetter' i = Simple (ReifiedIndexedSetter i)

newtype ReifiedIso s t a b

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

Constructors

Iso |
Fields runIso :: Iso s t a b

type ReifiedIso' s a = ReifiedIso s s a a

    type ReifiedIso' = Simple ReifiedIso

newtype ReifiedPrism s t a b

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

Constructors

Prism |
Fields runPrism :: Prism s t a b

type ReifiedPrism' s a = ReifiedPrism s s a a

    type ReifiedPrism' = Simple ReifiedPrism