Control.Monad.Trans.Identity

transformers-0.5.2.0: Concrete functor and monad transformers

Copyright | (c) 2007 Magnus Therning
License | BSD-style (see the file LICENSE)
Maintainer | R.Paterson@city.ac.uk
Stability | experimental
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Control.Monad.Trans.Identity

Contents

- The identity monad transformer
- Lifting other operations

Description

The identity monad transformer.

This is useful for functions parameterized by a monad transformer.

Synopsis

- newtype IdentityT f a = IdentityT {
  - runIdentityT :: f a
  }
- mapIdentityT :: (m a -> n b) -> IdentityT m a -> IdentityT n b
- liftCatch :: Catch e m a -> Catch e (IdentityT m) a
- liftCallCC :: CallCC m a b -> CallCC (IdentityT m) a b

# The identity monad transformer

newtype IdentityT f a

The trivial monad transformer, which maps a monad to an equivalent monad.

Constructors

IdentityT |
Fields runIdentityT :: f a

Instances

MonadTrans (IdentityT *) |
Monad m => Monad (IdentityT * m) |
Functor m => Functor (IdentityT * m) |
MonadFix m => MonadFix (IdentityT * m) |
Applicative m => Applicative (IdentityT * m) |
Foldable f => Foldable (IdentityT * f) |
Traversable f => Traversable (IdentityT * f) |
MonadZip m => MonadZip (IdentityT * m) |
Alternative m => Alternative (IdentityT * m) |
MonadPlus m => MonadPlus (IdentityT * m) |
MonadIO m => MonadIO (IdentityT * m) |
Show1 f => Show1 (IdentityT * f) |
Read1 f => Read1 (IdentityT * f) |
Ord1 f => Ord1 (IdentityT * f) |
Eq1 f => Eq1 (IdentityT * f) |
(Eq1 f, Eq a) => Eq (IdentityT * f a) |
(Ord1 f, Ord a) => Ord (IdentityT * f a) |
(Read1 f, Read a) => Read (IdentityT * f a) |
(Show1 f, Show a) => Show (IdentityT * f a) |

mapIdentityT :: (m a -> n b) -> IdentityT m a -> IdentityT n b

Lift a unary operation to the new monad.

# Lifting other operations

liftCatch :: Catch e m a -> Catch e (IdentityT m) a

Lift a `catchE` operation to the new monad.

liftCallCC :: CallCC m a b -> CallCC (IdentityT m) a b

Lift a `callCC` operation to the new monad.