mmorph-1.1.5: Monad morphisms
Safe HaskellTrustworthy
LanguageHaskell2010

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

Instances details
(MonadReader r (f (g m)), MonadWriter w (f (g m)), MonadState s (f (g m))) => MonadRWS r w s (ComposeT f g m) Source # 
Instance details

Defined in Control.Monad.Trans.Compose

MonadWriter w (f (g m)) => MonadWriter w (ComposeT f g m) Source # 
Instance details

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

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, MFunctor g, forall (m :: Type -> Type). Monad m => Monad (g m)) => MFunctor (ComposeT f g :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

hoist :: forall m n (b :: k). Monad m => (forall a. m a -> n a) -> ComposeT f g m b -> ComposeT f g n b Source #

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

Defined in Control.Monad.Trans.Compose

Methods

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

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

Defined in Control.Monad.Trans.Compose

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 #

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

Defined in Control.Monad.Trans.Compose

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 #

MonadFail (f (g m)) => MonadFail (ComposeT f g m) Source # 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

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

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

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

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

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

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

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

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

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

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

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

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

Defined in Control.Monad.Trans.Compose

Methods

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

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

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

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 # 
Instance details

Defined in Control.Monad.Trans.Compose

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.