constrained-monads-0.2.0.0: Typeclasses and instances for monads with constraints.

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Constrained.Trans

Description

This module duplicates the Control.Monad.Trans.Class module for constrained monads.

Synopsis

Documentation

class MonadTrans t where Source #

A class for monad transformers with constraints. See Control.Monad.Trans.Class for full documentation on the class without constraints.

Minimal complete definition

lift

Associated Types

type SuitableLift (t :: (* -> *) -> * -> *) (m :: * -> *) (a :: *) :: Constraint Source #

A type for monads that are liftable into the outer monad. For instance, since StateT is defined like so:

newtype StateT s m a = StateT { runStateT :: s -> m (a, s) }

the underlying monad needs not to be able to hold a, but (a, s).

Methods

lift :: (Monad m, SuitableLift t m a) => m a -> t m a Source #

Lift a monad into an outer monad.

Instances

MonadTrans MaybeT Source # 

Associated Types

type SuitableLift (MaybeT :: (* -> *) -> * -> *) (m :: * -> *) a :: Constraint Source #

Methods

lift :: (Monad m, SuitableLift MaybeT m a) => m a -> MaybeT m a Source #

MonadTrans (ExceptT e) Source # 

Associated Types

type SuitableLift (ExceptT e :: (* -> *) -> * -> *) (m :: * -> *) a :: Constraint Source #

Methods

lift :: (Monad m, SuitableLift (ExceptT e) m a) => m a -> ExceptT e m a Source #

MonadTrans (StateT r) Source # 

Associated Types

type SuitableLift (StateT r :: (* -> *) -> * -> *) (m :: * -> *) a :: Constraint Source #

Methods

lift :: (Monad m, SuitableLift (StateT r) m a) => m a -> StateT r m a Source #

MonadTrans (StateT r) Source # 

Associated Types

type SuitableLift (StateT r :: (* -> *) -> * -> *) (m :: * -> *) a :: Constraint Source #

Methods

lift :: (Monad m, SuitableLift (StateT r) m a) => m a -> StateT r m a Source #

MonadTrans (IdentityT *) Source # 

Associated Types

type SuitableLift (IdentityT * :: (* -> *) -> * -> *) (m :: * -> *) a :: Constraint Source #

Methods

lift :: (Monad m, SuitableLift (IdentityT *) m a) => m a -> IdentityT * m a Source #

MonadTrans (WriterT w) Source # 

Associated Types

type SuitableLift (WriterT w :: (* -> *) -> * -> *) (m :: * -> *) a :: Constraint Source #

Methods

lift :: (Monad m, SuitableLift (WriterT w) m a) => m a -> WriterT w m a Source #

MonadTrans (ContT * r) Source # 

Associated Types

type SuitableLift (ContT * r :: (* -> *) -> * -> *) (m :: * -> *) a :: Constraint Source #

Methods

lift :: (Monad m, SuitableLift (ContT * r) m a) => m a -> ContT * r m a Source #

MonadTrans (ReaderT * r) Source # 

Associated Types

type SuitableLift (ReaderT * r :: (* -> *) -> * -> *) (m :: * -> *) a :: Constraint Source #

Methods

lift :: (Monad m, SuitableLift (ReaderT * r) m a) => m a -> ReaderT * r m a Source #