mini-1.4.3.0: Minimal essentials
Safe HaskellSafe-Inferred
LanguageHaskell2010

Mini.Transformers.MaybeT

Description

Extend a monad with the ability to terminate a computation without a value

Synopsis

Type

newtype MaybeT m a Source #

A terminable transformer with inner monad m, return a

Constructors

MaybeT (m (Maybe a)) 

Instances

Instances details
MonadTrans MaybeT Source # 
Instance details

Defined in Mini.Transformers.MaybeT

Methods

lift :: Monad m => m a -> MaybeT m a Source #

Monad m => MonadFail (MaybeT m) Source # 
Instance details

Defined in Mini.Transformers.MaybeT

Methods

fail :: String -> MaybeT m a #

MonadIO m => MonadIO (MaybeT m) Source # 
Instance details

Defined in Mini.Transformers.MaybeT

Methods

liftIO :: IO a -> MaybeT m a #

Monad m => Alternative (MaybeT m) Source # 
Instance details

Defined in Mini.Transformers.MaybeT

Methods

empty :: MaybeT m a #

(<|>) :: MaybeT m a -> MaybeT m a -> MaybeT m a #

some :: MaybeT m a -> MaybeT m [a] #

many :: MaybeT m a -> MaybeT m [a] #

Monad m => Applicative (MaybeT m) Source # 
Instance details

Defined in Mini.Transformers.MaybeT

Methods

pure :: a -> MaybeT m a #

(<*>) :: MaybeT m (a -> b) -> MaybeT m a -> MaybeT m b #

liftA2 :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c #

(*>) :: MaybeT m a -> MaybeT m b -> MaybeT m b #

(<*) :: MaybeT m a -> MaybeT m b -> MaybeT m a #

Monad m => Functor (MaybeT m) Source # 
Instance details

Defined in Mini.Transformers.MaybeT

Methods

fmap :: (a -> b) -> MaybeT m a -> MaybeT m b #

(<$) :: a -> MaybeT m b -> MaybeT m a #

Monad m => Monad (MaybeT m) Source # 
Instance details

Defined in Mini.Transformers.MaybeT

Methods

(>>=) :: MaybeT m a -> (a -> MaybeT m b) -> MaybeT m b #

(>>) :: MaybeT m a -> MaybeT m b -> MaybeT m b #

return :: a -> MaybeT m a #

Runner

runMaybeT :: MaybeT m a -> m (Maybe a) Source #

Unwrap a MaybeT computation

Operations

nothing :: Monad m => MaybeT m a Source #

Terminate the computation without a value

anticipate :: Monad m => MaybeT m a -> MaybeT m (Maybe a) Source #

Run a computation and get its result