Module
Control.Monad.Maybe.Trans
- Package
- purescript-transformers
- Repository
- purescript/purescript-transformers
This module defines the MaybeT
monad transformer.
#MaybeT Source
newtype MaybeT :: (Type -> Type) -> Type -> Type
newtype MaybeT m a
The MaybeT
monad transformer.
This monad transformer extends the base monad, supporting failure and alternation via
the MonadPlus
type class.
Constructors
Instances
Newtype (MaybeT m a) _
(Functor m) => Functor (MaybeT m)
(Monad m) => Apply (MaybeT m)
(Monad m) => Applicative (MaybeT m)
(Monad m) => Bind (MaybeT m)
(Monad m) => Monad (MaybeT m)
MonadTrans MaybeT
(Monad m) => Alt (MaybeT m)
(Monad m) => Plus (MaybeT m)
(Monad m) => Alternative (MaybeT m)
(Monad m) => MonadPlus (MaybeT m)
(MonadRec m) => MonadRec (MaybeT m)
(MonadEffect m) => MonadEffect (MaybeT m)
(MonadCont m) => MonadCont (MaybeT m)
(MonadThrow e m) => MonadThrow e (MaybeT m)
(MonadError e m) => MonadError e (MaybeT m)
(MonadAsk r m) => MonadAsk r (MaybeT m)
(MonadReader r m) => MonadReader r (MaybeT m)
(MonadState s m) => MonadState s (MaybeT m)
(MonadTell w m) => MonadTell w (MaybeT m)
(MonadWriter w m) => MonadWriter w (MaybeT m)
(Monad m, Semigroup a) => Semigroup (MaybeT m a)
(Monad m, Monoid a) => Monoid (MaybeT m a)
Re-exports from Control.Monad.Trans.Class
#MonadTrans Source
class MonadTrans :: ((Type -> Type) -> Type -> Type) -> Constraint
class MonadTrans t where
The MonadTrans
type class represents monad transformers.
A monad transformer is a type constructor of kind (* -> *) -> * -> *
, which
takes a Monad
as its first argument, and returns another Monad
.
This allows us to add additional effects to an existing monad. By iterating this process, we create monad transformer stacks, which contain all of the effects required for a particular computation.
The laws state that lift
is a Monad
morphism.
Laws:
lift (pure a) = pure a
lift (do { x <- m ; y }) = do { x <- lift m ; lift y }
Members
- Modules
- Control.
Comonad. Env - Control.
Comonad. Env. Class - Control.
Comonad. Env. Trans - Control.
Comonad. Store - Control.
Comonad. Store. Class - Control.
Comonad. Store. Trans - Control.
Comonad. Traced - Control.
Comonad. Traced. Class - Control.
Comonad. Traced. Trans - Control.
Comonad. Trans. Class - Control.
Monad. Cont - Control.
Monad. Cont. Class - Control.
Monad. Cont. Trans - Control.
Monad. Error. Class - Control.
Monad. Except - Control.
Monad. Except. Trans - Control.
Monad. Identity. Trans - Control.
Monad. List. Trans - Control.
Monad. Maybe. Trans - Control.
Monad. RWS - Control.
Monad. RWS. Trans - Control.
Monad. Reader - Control.
Monad. Reader. Class - Control.
Monad. Reader. Trans - Control.
Monad. State - Control.
Monad. State. Class - Control.
Monad. State. Trans - Control.
Monad. Trans. Class - Control.
Monad. Writer - Control.
Monad. Writer. Class - Control.
Monad. Writer. Trans