lens-4.13: Lenses, Folds and Traversals

Copyright | (C) 2012-15 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | Rank2Types
Safe Haskell | Safe
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 Source

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 Source

    type ReifiedLens' = Simple ReifiedLens

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

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

    type ReifiedIndexedLens' i = Simple (ReifiedIndexedLens i)

newtype ReifiedIndexedTraversal i s t a b Source

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 Source

    type ReifiedIndexedTraversal' i = Simple (ReifiedIndexedTraversal i)

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

type ReifiedTraversal' s a = ReifiedTraversal s s a a Source

    type ReifiedTraversal' = Simple ReifiedTraversal

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

Instances

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

newtype ReifiedIndexedGetter i s a Source

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

Constructors

IndexedGetter |

Fields

runIndexedGetter :: IndexedGetter i s a

Instances

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

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

Instances

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

newtype ReifiedIndexedFold i s a Source

Constructors

IndexedFold |

Fields

runIndexedFold :: IndexedFold i s a

Instances

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

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

type ReifiedSetter' s a = ReifiedSetter s s a a Source

    type ReifiedSetter' = Simple ReifiedSetter

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

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

    type ReifiedIndexedSetter' i = Simple (ReifiedIndexedSetter i)

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

type ReifiedIso' s a = ReifiedIso s s a a Source

    type ReifiedIso' = Simple ReifiedIso

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

type ReifiedPrism' s a = ReifiedPrism s s a a Source

    type ReifiedPrism' = Simple ReifiedPrism