mmorph-1.1.1: Monad morphisms

Safe HaskellSafe
LanguageHaskell98

Control.Monad.Trans.Compose

Contents

Description

Composition of monad transformers. A higher-order version of Data.Functor.Compose.

Synopsis

ComposeT

newtype ComposeT (f :: (* -> *) -> * -> *) (g :: (* -> *) -> * -> *) m a infixr 9 Source #

Composition of monad transformers.

Constructors

ComposeT infixr 9 

Fields

Instances

MonadRWS r w s (f (g m)) => MonadRWS r w s (ComposeT f g m) Source # 
MonadWriter w (f (g m)) => MonadWriter w (ComposeT f g m) Source # 

Methods

writer :: (a, w) -> ComposeT f g m a #

tell :: w -> ComposeT f g m () #

listen :: ComposeT f g m a -> ComposeT f g m (a, w) #

pass :: ComposeT f g m (a, w -> w) -> ComposeT f g m a #

MonadState s (f (g m)) => MonadState s (ComposeT f g m) Source # 

Methods

get :: ComposeT f g m s #

put :: s -> ComposeT f g m () #

state :: (s -> (a, s)) -> ComposeT f g m a #

MonadReader r (f (g m)) => MonadReader r (ComposeT f g m) Source # 

Methods

ask :: ComposeT f g m r #

local :: (r -> r) -> ComposeT f g m a -> ComposeT f g m a #

reader :: (r -> a) -> ComposeT f g m a #

MonadError e (f (g m)) => MonadError e (ComposeT f g m) Source # 

Methods

throwError :: e -> ComposeT f g m a #

catchError :: ComposeT f g m a -> (e -> ComposeT f g m a) -> ComposeT f g m a #

(MFunctor * f, MonadTrans f, MonadTrans g) => MonadTrans (ComposeT f g) Source # 

Methods

lift :: Monad m => m a -> ComposeT f g m a #

Monad (f (g m)) => Monad (ComposeT f g m) Source # 

Methods

(>>=) :: ComposeT f g m a -> (a -> ComposeT f g m b) -> ComposeT f g m b #

(>>) :: ComposeT f g m a -> ComposeT f g m b -> ComposeT f g m b #

return :: a -> ComposeT f g m a #

fail :: String -> ComposeT f g m a #

Functor (f (g m)) => Functor (ComposeT f g m) Source # 

Methods

fmap :: (a -> b) -> ComposeT f g m a -> ComposeT f g m b #

(<$) :: a -> ComposeT f g m b -> ComposeT f g m a #

Applicative (f (g m)) => Applicative (ComposeT f g m) Source # 

Methods

pure :: a -> ComposeT f g m a #

(<*>) :: ComposeT f g m (a -> b) -> ComposeT f g m a -> ComposeT f g m b #

liftA2 :: (a -> b -> c) -> ComposeT f g m a -> ComposeT f g m b -> ComposeT f g m c #

(*>) :: ComposeT f g m a -> ComposeT f g m b -> ComposeT f g m b #

(<*) :: ComposeT f g m a -> ComposeT f g m b -> ComposeT f g m a #

Foldable (f (g m)) => Foldable (ComposeT f g m) Source # 

Methods

fold :: Monoid m => ComposeT f g m m -> m #

foldMap :: Monoid m => (a -> m) -> ComposeT f g m a -> m #

foldr :: (a -> b -> b) -> b -> ComposeT f g m a -> b #

foldr' :: (a -> b -> b) -> b -> ComposeT f g m a -> b #

foldl :: (b -> a -> b) -> b -> ComposeT f g m a -> b #

foldl' :: (b -> a -> b) -> b -> ComposeT f g m a -> b #

foldr1 :: (a -> a -> a) -> ComposeT f g m a -> a #

foldl1 :: (a -> a -> a) -> ComposeT f g m a -> a #

toList :: ComposeT f g m a -> [a] #

null :: ComposeT f g m a -> Bool #

length :: ComposeT f g m a -> Int #

elem :: Eq a => a -> ComposeT f g m a -> Bool #

maximum :: Ord a => ComposeT f g m a -> a #

minimum :: Ord a => ComposeT f g m a -> a #

sum :: Num a => ComposeT f g m a -> a #

product :: Num a => ComposeT f g m a -> a #

Traversable (f (g m)) => Traversable (ComposeT f g m) Source # 

Methods

traverse :: Applicative f => (a -> f b) -> ComposeT f g m a -> f (ComposeT f g m b) #

sequenceA :: Applicative f => ComposeT f g m (f a) -> f (ComposeT f g m a) #

mapM :: Monad m => (a -> m b) -> ComposeT f g m a -> m (ComposeT f g m b) #

sequence :: Monad m => ComposeT f g m (m a) -> m (ComposeT f g m a) #

MonadIO (f (g m)) => MonadIO (ComposeT f g m) Source # 

Methods

liftIO :: IO a -> ComposeT f g m a #

Alternative (f (g m)) => Alternative (ComposeT f g m) Source # 

Methods

empty :: ComposeT f g m a #

(<|>) :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a #

some :: ComposeT f g m a -> ComposeT f g m [a] #

many :: ComposeT f g m a -> ComposeT f g m [a] #

MonadPlus (f (g m)) => MonadPlus (ComposeT f g m) Source # 

Methods

mzero :: ComposeT f g m a #

mplus :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a #

MonadCont (f (g m)) => MonadCont (ComposeT f g m) Source # 

Methods

callCC :: ((a -> ComposeT f g m b) -> ComposeT f g m a) -> ComposeT f g m a #

Eq (f (g m) a) => Eq (ComposeT f g m a) Source # 

Methods

(==) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

(/=) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

Ord (f (g m) a) => Ord (ComposeT f g m a) Source # 

Methods

compare :: ComposeT f g m a -> ComposeT f g m a -> Ordering #

(<) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

(<=) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

(>) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

(>=) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

max :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a #

min :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a #

Read (f (g m) a) => Read (ComposeT f g m a) Source # 

Methods

readsPrec :: Int -> ReadS (ComposeT f g m a) #

readList :: ReadS [ComposeT f g m a] #

readPrec :: ReadPrec (ComposeT f g m a) #

readListPrec :: ReadPrec [ComposeT f g m a] #

Show (f (g m) a) => Show (ComposeT f g m a) Source # 

Methods

showsPrec :: Int -> ComposeT f g m a -> ShowS #

show :: ComposeT f g m a -> String #

showList :: [ComposeT f g m a] -> ShowS #

mapComposeT :: (f (g m) a -> p (q n) b) -> ComposeT f g m a -> ComposeT p q n b Source #

Transform the computation inside a ComposeT.