transformers-0.5.4.0: Concrete functor and monad transformers

Copyright(c) 2007 Magnus Therning
LicenseBSD-style (see the file LICENSE)
MaintainerR.Paterson@city.ac.uk
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Control.Monad.Trans.Identity

Contents

Description

The identity monad transformer.

This is useful for functions parameterized by a monad transformer.

Synopsis

The identity monad transformer

newtype IdentityT f a Source #

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

Constructors

IdentityT 

Fields

Instances

MonadTrans (IdentityT *) Source # 

Methods

lift :: Monad m => m a -> IdentityT * m a Source #

Monad m => Monad (IdentityT * m) Source # 

Methods

(>>=) :: IdentityT * m a -> (a -> IdentityT * m b) -> IdentityT * m b #

(>>) :: IdentityT * m a -> IdentityT * m b -> IdentityT * m b #

return :: a -> IdentityT * m a #

fail :: String -> IdentityT * m a #

Functor m => Functor (IdentityT * m) Source # 

Methods

fmap :: (a -> b) -> IdentityT * m a -> IdentityT * m b #

(<$) :: a -> IdentityT * m b -> IdentityT * m a #

MonadFix m => MonadFix (IdentityT * m) Source # 

Methods

mfix :: (a -> IdentityT * m a) -> IdentityT * m a #

MonadFail m => MonadFail (IdentityT * m) Source # 

Methods

fail :: String -> IdentityT * m a #

Applicative m => Applicative (IdentityT * m) Source # 

Methods

pure :: a -> IdentityT * m a #

(<*>) :: IdentityT * m (a -> b) -> IdentityT * m a -> IdentityT * m b #

(*>) :: IdentityT * m a -> IdentityT * m b -> IdentityT * m b #

(<*) :: IdentityT * m a -> IdentityT * m b -> IdentityT * m a #

Foldable f => Foldable (IdentityT * f) Source # 

Methods

fold :: Monoid m => IdentityT * f m -> m #

foldMap :: Monoid m => (a -> m) -> IdentityT * f a -> m #

foldr :: (a -> b -> b) -> b -> IdentityT * f a -> b #

foldr' :: (a -> b -> b) -> b -> IdentityT * f a -> b #

foldl :: (b -> a -> b) -> b -> IdentityT * f a -> b #

foldl' :: (b -> a -> b) -> b -> IdentityT * f a -> b #

foldr1 :: (a -> a -> a) -> IdentityT * f a -> a #

foldl1 :: (a -> a -> a) -> IdentityT * f a -> a #

toList :: IdentityT * f a -> [a] #

null :: IdentityT * f a -> Bool #

length :: IdentityT * f a -> Int #

elem :: Eq a => a -> IdentityT * f a -> Bool #

maximum :: Ord a => IdentityT * f a -> a #

minimum :: Ord a => IdentityT * f a -> a #

sum :: Num a => IdentityT * f a -> a #

product :: Num a => IdentityT * f a -> a #

Traversable f => Traversable (IdentityT * f) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> IdentityT * f a -> f (IdentityT * f b) #

sequenceA :: Applicative f => IdentityT * f (f a) -> f (IdentityT * f a) #

mapM :: Monad m => (a -> m b) -> IdentityT * f a -> m (IdentityT * f b) #

sequence :: Monad m => IdentityT * f (m a) -> m (IdentityT * f a) #

Eq1 f => Eq1 (IdentityT * f) Source # 

Methods

liftEq :: (a -> b -> Bool) -> IdentityT * f a -> IdentityT * f b -> Bool #

Ord1 f => Ord1 (IdentityT * f) Source # 

Methods

liftCompare :: (a -> b -> Ordering) -> IdentityT * f a -> IdentityT * f b -> Ordering #

Read1 f => Read1 (IdentityT * f) Source # 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (IdentityT * f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [IdentityT * f a] #

Show1 f => Show1 (IdentityT * f) Source # 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> IdentityT * f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [IdentityT * f a] -> ShowS #

MonadZip m => MonadZip (IdentityT * m) Source # 

Methods

mzip :: IdentityT * m a -> IdentityT * m b -> IdentityT * m (a, b) #

mzipWith :: (a -> b -> c) -> IdentityT * m a -> IdentityT * m b -> IdentityT * m c #

munzip :: IdentityT * m (a, b) -> (IdentityT * m a, IdentityT * m b) #

MonadIO m => MonadIO (IdentityT * m) Source # 

Methods

liftIO :: IO a -> IdentityT * m a #

Alternative m => Alternative (IdentityT * m) Source # 

Methods

empty :: IdentityT * m a #

(<|>) :: IdentityT * m a -> IdentityT * m a -> IdentityT * m a #

some :: IdentityT * m a -> IdentityT * m [a] #

many :: IdentityT * m a -> IdentityT * m [a] #

MonadPlus m => MonadPlus (IdentityT * m) Source # 

Methods

mzero :: IdentityT * m a #

mplus :: IdentityT * m a -> IdentityT * m a -> IdentityT * m a #

(Eq1 f, Eq a) => Eq (IdentityT * f a) Source # 

Methods

(==) :: IdentityT * f a -> IdentityT * f a -> Bool #

(/=) :: IdentityT * f a -> IdentityT * f a -> Bool #

(Ord1 f, Ord a) => Ord (IdentityT * f a) Source # 

Methods

compare :: IdentityT * f a -> IdentityT * f a -> Ordering #

(<) :: IdentityT * f a -> IdentityT * f a -> Bool #

(<=) :: IdentityT * f a -> IdentityT * f a -> Bool #

(>) :: IdentityT * f a -> IdentityT * f a -> Bool #

(>=) :: IdentityT * f a -> IdentityT * f a -> Bool #

max :: IdentityT * f a -> IdentityT * f a -> IdentityT * f a #

min :: IdentityT * f a -> IdentityT * f a -> IdentityT * f a #

(Read1 f, Read a) => Read (IdentityT * f a) Source # 
(Show1 f, Show a) => Show (IdentityT * f a) Source # 

Methods

showsPrec :: Int -> IdentityT * f a -> ShowS #

show :: IdentityT * f a -> String #

showList :: [IdentityT * f a] -> ShowS #

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

Lift a unary operation to the new monad.

Lifting other operations

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

Lift a catchE operation to the new monad.

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

Lift a callCC operation to the new monad.