Modules 24
Control.Monad.Identity
experimental- Computation type:
- Simple function application.
- Binding strategy:
- The bound function is applied to the input value.
Identity x >>= f == f x
- Useful for:
- Monads can be derived from monad transformers applied to the
Identity monad.
- Zero and plus:
- None.
- Example type:
Identitya
The Identity monad is a monad that does not embody any computational strategy.
It simply applies the bound function to its input without any modification.
Computationally, there is no reason to use the Identity monad
instead of the much simpler act of simply applying functions to their arguments.
The purpose of the Identity monad is its fundamental role in the theory
of monad transformers.
Any monad transformer applied to the Identity monad yields a non-transformer
version of that monad.
module Data.Functor.Identity aihc-base-4.21.2.0 · 1 declaration
module Control.Monad.Trans.Identity transformers-0.6.3.0 · 4 declarations
liftCallCC :: CallCC m a b -> CallCC (IdentityT m) a b
Lift a callCC operation to the new monad.
liftCatch :: Catch e m a -> Catch e (IdentityT m) a
Lift a catchE operation to the new monad.
mapIdentityT :: (m a -> n b) -> IdentityT m a -> IdentityT n b
Lift a unary operation to the new monad.
newtype IdentityT f a
The trivial monad transformer, which maps a monad to an equivalent monad.
IdentityT :: f a -> IdentityT f a
runIdentityT :: IdentityT f a -> f a
- Maintainer
- libraries@haskell.org
- Portability
- portable
- Copyright
- (c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology 2001, (c) Jeff Newbern 2003-2006, (c) Andriy Palamarchuk 2006
- License
- BSD-style (see the file LICENSE)
Build record and source files
Community contribution. The service has not verified this documentation. The generator reported 6 diagnostics.
Target: Linux on x86-64. Some inferred types and resolved links are not available.
Generator: aihc-haddock-858b1951-web-1
Metadata snapshot: 032b29dc8ecd03eaae7b1a84a40ef8560125381762749b2f47333bc9a4f4bb8e
Open the dependency plan · Download the documentation model
- aihc-base-4.21.2.0 · Core library · Cabal file
- aihc-prim-0.13.0 · Core library · Cabal file
- aihc-rts-1.0.2 · Core library · Cabal file
- mtl-2.3.2 · Cabal revision 1 · Cabal file · Source archive
- transformers-0.6.3.0 · Cabal revision 2 · Cabal file · Source archive