Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Control.Reference.Types
Contents
Description
This module defines the polymorphic types of the created references. The actual type of a reference can be different for every usage, the polymorphic type gives a lower bound on the actual one.
- type Simple t s a = t s s a a
- type Getter r s t a b = Reference MU r MU MU s t a b
- type Setter w s t a b = Reference w MU MU MU s t a b
- type Iso s t a b = forall w r w' r'. (RefMonads w r, RefMonads w' r') => Reference w r w' r' s t a b
- type Prism s t a b = forall w r w' r'. (RefMonads w r, RefMonads w' r', MonadPlus r, Morph Maybe r, MonadPlus w', Morph Maybe w') => Reference w r w' r' s t a b
- type Lens s t a b = forall w r. RefMonads w r => Reference w r MU MU s t a b
- type RefPlus s t a b = forall w r. (RefMonads w r, MonadPlus r) => Reference w r MU MU s t a b
- type Partial s t a b = forall w r. (Functor w, Applicative w, Monad w, Functor r, Applicative r, MonadPlus r, Morph Maybe r) => Reference w r MU MU s t a b
- type Traversal s t a b = forall w r. (RefMonads w r, MonadPlus r, Morph Maybe r, Morph [] r) => Reference w r MU MU s t a b
- class (Morph IO w, Morph IO r, MorphControl IO w, MorphControl IO r) => IOMonads w r
- type IOLens s t a b = forall w r. (RefMonads w r, IOMonads w r) => Reference w r MU MU s t a b
- type IOPartial s t a b = forall w r. (RefMonads w r, IOMonads w r, MonadPlus r, Morph Maybe r) => Reference w r MU MU s t a b
- type IOTraversal s t a b = forall w r. (RefMonads w r, IOMonads w r, MonadPlus r, Morph Maybe r, Morph [] r) => Reference w r MU MU s t a b
- type StateLens st m s t a b = forall w r. (RefMonads w r, Morph (StateT st m) w, Morph (StateT st m) r) => Reference w r MU MU s t a b
- type StatePartial st m s t a b = forall w r. (RefMonads w r, Morph (StateT st m) w, MonadPlus r, Morph Maybe r, Morph (StateT st m) r) => Reference w r MU MU s t a b
- type StateTraversal st m s t a b = forall w r. (RefMonads w r, Morph (StateT st m) w, MonadPlus r, Morph Maybe r, Morph [] r, Morph (StateT st m) r) => Reference w r MU MU s t a b
- type WriterLens st m s t a b = forall w r. (RefMonads w r, Morph (WriterT st m) w, Morph (WriterT st m) r) => Reference w r MU MU s t a b
- type WriterPartial st m s t a b = forall w r. (RefMonads w r, Morph (WriterT st m) w, MonadPlus r, Morph Maybe r, Morph (WriterT st m) r) => Reference w r MU MU s t a b
- type WriterTraversal st m s t a b = forall w r. (RefMonads w r, Morph (WriterT st m) w, MonadPlus r, Morph Maybe r, Morph [] r, Morph (WriterT st m) r) => Reference w r MU MU s t a b
- type STLens st s t a b = forall w r. (RefMonads w r, Morph (ST st) w, Morph (ST st) r) => Reference w r MU MU s t a b
- type STPartial st s t a b = forall w r. (RefMonads w r, Morph (ST st) w, MonadPlus r, Morph Maybe r, Morph (ST st) r) => Reference w r MU MU s t a b
- type STTraversal st s t a b = forall w r. (RefMonads w r, Morph (ST st) w, MonadPlus r, Morph Maybe r, Morph [] r, Morph (ST st) r) => Reference w r MU MU s t a b
- class MorphControl m1 m2 where
Documentation
Pure references
type Iso s t a b = forall w r w' r'. (RefMonads w r, RefMonads w' r') => Reference w r w' r' s t a b Source #
A two-way Reference
that represents an isomorphism between two datatypes.
Can be used to access the same data in two different representations.
type Prism s t a b = forall w r w' r'. (RefMonads w r, RefMonads w' r', MonadPlus r, Morph Maybe r, MonadPlus w', Morph Maybe w') => Reference w r w' r' s t a b Source #
A partial lens that can be turned to get a total lens.
type RefPlus s t a b = forall w r. (RefMonads w r, MonadPlus r) => Reference w r MU MU s t a b Source #
A reference that may not have the accessed element, and that can look for the accessed element in multiple locations.
type Partial s t a b = forall w r. (Functor w, Applicative w, Monad w, Functor r, Applicative r, MonadPlus r, Morph Maybe r) => Reference w r MU MU s t a b Source #
type Traversal s t a b = forall w r. (RefMonads w r, MonadPlus r, Morph Maybe r, Morph [] r) => Reference w r MU MU s t a b Source #
A reference that can access data that is available in a number of instances inside the contexts.
Any reference that is a Traversal
should perform the action given to its
updater in the exactly the same number of times that is the number of the values
returned by it's getRef
function.
References for IO
type IOLens s t a b = forall w r. (RefMonads w r, IOMonads w r) => Reference w r MU MU s t a b Source #
A reference that can access mutable data.
type IOPartial s t a b = forall w r. (RefMonads w r, IOMonads w r, MonadPlus r, Morph Maybe r) => Reference w r MU MU s t a b Source #
A reference that can access mutable data that may not exist in the context.
type IOTraversal s t a b = forall w r. (RefMonads w r, IOMonads w r, MonadPlus r, Morph Maybe r, Morph [] r) => Reference w r MU MU s t a b Source #
References for StateT
type StateLens st m s t a b = forall w r. (RefMonads w r, Morph (StateT st m) w, Morph (StateT st m) r) => Reference w r MU MU s t a b Source #
A reference that can access a value inside a StateT
transformed monad.
type StatePartial st m s t a b = forall w r. (RefMonads w r, Morph (StateT st m) w, MonadPlus r, Morph Maybe r, Morph (StateT st m) r) => Reference w r MU MU s t a b Source #
A reference that can access a value inside a StateT
transformed monad
that may not exist.
type StateTraversal st m s t a b = forall w r. (RefMonads w r, Morph (StateT st m) w, MonadPlus r, Morph Maybe r, Morph [] r, Morph (StateT st m) r) => Reference w r MU MU s t a b Source #
A reference that can access a value inside a StateT
transformed monad
that may exist in multiple instances.
References for WriterT
type WriterLens st m s t a b = forall w r. (RefMonads w r, Morph (WriterT st m) w, Morph (WriterT st m) r) => Reference w r MU MU s t a b Source #
A reference that can access a value inside a WriterT
transformed monad.
type WriterPartial st m s t a b = forall w r. (RefMonads w r, Morph (WriterT st m) w, MonadPlus r, Morph Maybe r, Morph (WriterT st m) r) => Reference w r MU MU s t a b Source #
A reference that can access a value inside a WriterT
transformed monad
that may not exist.
type WriterTraversal st m s t a b = forall w r. (RefMonads w r, Morph (WriterT st m) w, MonadPlus r, Morph Maybe r, Morph [] r, Morph (WriterT st m) r) => Reference w r MU MU s t a b Source #
A reference that can access a value inside a WriteT
transformed monad
that may exist in multiple instances.
References for ST
type STLens st s t a b = forall w r. (RefMonads w r, Morph (ST st) w, Morph (ST st) r) => Reference w r MU MU s t a b Source #
A reference that can access a value inside an ST
transformed monad.
type STPartial st s t a b = forall w r. (RefMonads w r, Morph (ST st) w, MonadPlus r, Morph Maybe r, Morph (ST st) r) => Reference w r MU MU s t a b Source #
A reference that can access a value inside an ST
transformed monad
that may not exist.
type STTraversal st s t a b = forall w r. (RefMonads w r, Morph (ST st) w, MonadPlus r, Morph Maybe r, Morph [] r, Morph (ST st) r) => Reference w r MU MU s t a b Source #
A reference that can access a value inside an ST
transformed monad
that may exist in multiple instances.
class MorphControl m1 m2 where Source #
A class for representing calculation in a simpler monad.
pullBack . sink === id