mmorph-1.2.0: Monad morphisms

Safe Haskell | Trustworthy
Language | Haskell2010

Control.Monad.Trans.Compose

Contents

- ComposeT

Description

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

Synopsis

- newtype ComposeT (f :: (* -> *) -> * -> *) (g :: (* -> *) -> * -> *) m a = ComposeT {
  - getComposeT :: f (g m) a
  }
- mapComposeT :: (f (g m) a -> p (q n) b) -> ComposeT f g m a -> ComposeT p q n b

# ComposeT

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

Composition of monad transformers.

Constructors

ComposeT infixr 9 |

Fields

- getComposeT :: f (g m) a

#### 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
(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 #
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 Source # catchError :: ComposeT f g m a -> (e -> ComposeT f g m a) -> ComposeT f g m a Source #
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 Source # local :: (r -> r) -> ComposeT f g m a -> ComposeT f g m a Source # reader :: (r -> a) -> ComposeT f g m a Source #
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 Source # put :: s -> ComposeT f g m () Source # state :: (s -> (a, s)) -> ComposeT f g m a Source #
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 Source # tell :: w -> ComposeT f g m () Source # listen :: ComposeT f g m a -> ComposeT f g m (a, w) Source # pass :: ComposeT f g m (a, w -> w) -> ComposeT f g m a 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 Source #
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 Source #
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 Source #
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 Source #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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) Source #

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

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

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

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 Source # (<|>) :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a Source # some :: ComposeT f g m a -> ComposeT f g m [a] Source # many :: ComposeT f g m a -> ComposeT f g m [a] Source #
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 Source #

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

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

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

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

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 Source # (<$) :: a -> ComposeT f g m b -> ComposeT f g m a Source #
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 Source # (>>) :: ComposeT f g m a -> ComposeT f g m b -> ComposeT f g m b Source # return :: a -> ComposeT f g m a Source #
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 Source # mplus :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a Source #
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 Source #
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) Source # readList :: ReadS [ComposeT f g m a] Source # readPrec :: ReadPrec (ComposeT f g m a) Source # readListPrec :: ReadPrec [ComposeT f g m a] Source #
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 Source # show :: ComposeT f g m a -> String Source # showList :: [ComposeT f g m a] -> ShowS Source #
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 Source # (/=) :: ComposeT f g m a -> ComposeT f g m a -> Bool Source #
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 Source #

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

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

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

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

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

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

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`.