base-4.8.0.0: Basic libraries

Copyright(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology 2001
LicenseBSD-style (see the file LICENSE)
Maintainerross@soi.city.ac.uk
Stabilityexperimental
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Functor.Identity

Description

The identity functor and monad.

This trivial type constructor serves two purposes:

  • It can be used with functions parameterized by functor or monad classes.
  • It can be used as a base monad to which a series of monad transformers may be applied to construct a composite monad. Most monad transformer modules include the special case of applying the transformer to Identity. For example, State s is an abbreviation for StateT s Identity.

Since: 4.8.0.0

Synopsis

Documentation

newtype Identity a Source

Identity functor and monad. (a non-strict monad)

Since: 4.8.0.0

Constructors

Identity 

Fields

runIdentity :: a
 

Instances

Monad Identity Source 
Functor Identity Source 
MonadFix Identity Source 
Applicative Identity Source 
Foldable Identity Source 
Traversable Identity Source 
Generic1 Identity Source 
MonadZip Identity Source 
Eq a => Eq (Identity a) Source 
Data a => Data (Identity a) Source 
Ord a => Ord (Identity a) Source 
Read a => Read (Identity a) Source

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Show a => Show (Identity a) Source

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Generic (Identity a) Source 
type Rep1 Identity Source 
type Rep (Identity a) Source