mini-1.4.0.1: Minimal essentials
Safe HaskellSafe-Inferred
LanguageHaskell2010

Mini.Transformers.EitherT

Description

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

Synopsis

Type

newtype EitherT e m a Source #

A terminable transformer with termination e, inner monad m, return a

Constructors

EitherT (m (Either e a)) 

Instances

Instances details
MonadTrans (EitherT e) Source # 
Instance details

Defined in Mini.Transformers.EitherT

Methods

lift :: Monad m => m a -> EitherT e m a Source #

(Monad m, Monoid e) => Alternative (EitherT e m) Source # 
Instance details

Defined in Mini.Transformers.EitherT

Methods

empty :: EitherT e m a #

(<|>) :: EitherT e m a -> EitherT e m a -> EitherT e m a #

some :: EitherT e m a -> EitherT e m [a] #

many :: EitherT e m a -> EitherT e m [a] #

Monad m => Applicative (EitherT e m) Source # 
Instance details

Defined in Mini.Transformers.EitherT

Methods

pure :: a -> EitherT e m a #

(<*>) :: EitherT e m (a -> b) -> EitherT e m a -> EitherT e m b #

liftA2 :: (a -> b -> c) -> EitherT e m a -> EitherT e m b -> EitherT e m c #

(*>) :: EitherT e m a -> EitherT e m b -> EitherT e m b #

(<*) :: EitherT e m a -> EitherT e m b -> EitherT e m a #

Monad m => Functor (EitherT e m) Source # 
Instance details

Defined in Mini.Transformers.EitherT

Methods

fmap :: (a -> b) -> EitherT e m a -> EitherT e m b #

(<$) :: a -> EitherT e m b -> EitherT e m a #

Monad m => Monad (EitherT e m) Source # 
Instance details

Defined in Mini.Transformers.EitherT

Methods

(>>=) :: EitherT e m a -> (a -> EitherT e m b) -> EitherT e m b #

(>>) :: EitherT e m a -> EitherT e m b -> EitherT e m b #

return :: a -> EitherT e m a #

Runner

runEitherT :: EitherT e m a -> m (Either e a) Source #

Unwrap an EitherT computation

Operations

left :: Monad m => e -> EitherT e m a Source #

Terminate the computation with a value

anticipate :: Monad m => EitherT e m a -> EitherT e m (Either e a) Source #

Run a computation and get its result