data EitherT : Type -> (Type -> Type) -> Type -> Type
A monad transformer extending an inner monad with the ability to throw and
catch exceptions.
Sequenced actions produce an exception if either action produces an
exception, with preference for the first exception. If neither produce an
exception, neither does the sequence of actions.
`MaybeT m a` is equivalent to `EitherT () m a`, that is, an computation
that can only throw a single, information-less exception.
Totality: total
Visibility: public export
Constructor: MkEitherT : m (Either e a) -> EitherT e m a
Hints:
(Monad m, Monoid e) => Alternative (EitherT e m)
Applicative m => Applicative (EitherT e m)
Eq (m (Either e a)) => Eq (EitherT e m a)
Foldable m => Foldable (EitherT e m)
Functor m => Functor (EitherT e m)
HasIO m => HasIO (EitherT e m)
Monad m => Monad (EitherT e m)
Monad m => MonadError e (EitherT e m)
MonadTrans (EitherT e)
Ord (m (Either e a)) => Ord (EitherT e m a)
Monad m => Semigroup (EitherT e m a)
Show (m (Either e a)) => Show (EitherT e m a)
Traversable m => Traversable (EitherT e m)
runEitherT : EitherT e m a -> m (Either e a)
Unwrap an `EitherT` computation.
Totality: total
Visibility: public exporteitherT : Monad m => (a -> m c) -> (b -> m c) -> EitherT a m b -> m c
Run an `EitherT` computation, handling results and exceptions with seperate
functions.
This is a version of `either` lifted to work with `EitherT`.
Totality: total
Visibility: public exportmapEitherT : (m (Either e a) -> n (Either e' a')) -> EitherT e m a -> EitherT e' n a'
Map over the underlying monadic computation.
Totality: total
Visibility: public exportbimapEitherT : Functor m => (a -> c) -> (b -> d) -> EitherT a m b -> EitherT c m d
Map over the result or the exception of a monadic computation.
Totality: total
Visibility: public exportleft : Applicative m => e -> EitherT e m a
A version of `Left` lifted to work with `EitherT`.
This is equivalent to `throwE`.
Totality: total
Visibility: public exportright : Applicative m => a -> EitherT e m a
A version of `Right` lifted to work with `EitherT`.
This is equivalent to `pure`.
Totality: total
Visibility: public exportswapEitherT : Functor m => EitherT e m a -> EitherT a m e
Swap the result and the exception of a monadic computation.
Totality: total
Visibility: public exportthrowE : Applicative m => e -> EitherT e m a
Throw an exception in a monadic computation.
Totality: total
Visibility: public exportcatchE : Monad m => EitherT e m a -> (e -> EitherT e' m a) -> EitherT e' m a
Handle an exception thrown in a monadic computation.
Since the handler catches all errors thrown in the computation, it may
raise a different exception type.
Totality: total
Visibility: public export