Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- mapExcept :: (Either e a -> Either e' b) -> Except e a -> Except e' b
- mapExceptT :: (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b
- runExcept :: Except e a -> Either e a
- runExceptT :: ExceptT e m a -> m (Either e a)
- withExcept :: (e -> e') -> Except e a -> Except e' a
- withExceptT :: forall (m :: Type -> Type) e e' a. Functor m => (e -> e') -> ExceptT e m a -> ExceptT e' m a
- type Except e = ExceptT e Identity
- newtype ExceptT e (m :: Type -> Type) a = ExceptT (m (Either e a))
- throwE :: forall (m :: Type -> Type) e a. Monad m => e -> ExceptT e m a
- except :: forall (m :: Type -> Type) e a. Monad m => Either e a -> ExceptT e m a
- catchE :: forall (m :: Type -> Type) e a e'. Monad m => ExceptT e m a -> (e -> ExceptT e' m a) -> ExceptT e' m a
- transExcept :: forall t m e a. (MonadTransTunnel t, Applicative (Tunnel t), Monad m) => t (ExceptT e m) a -> t m (Either e a)
Documentation
mapExceptT :: (m (Either e a) -> n (Either e' b)) -> ExceptT e m a -> ExceptT e' n b #
Map the unwrapped computation using the given function.
runExceptT
(mapExceptT
f m) = f (runExceptT
m)
runExcept :: Except e a -> Either e a #
Extractor for computations in the exception monad.
(The inverse of except
).
runExceptT :: ExceptT e m a -> m (Either e a) #
The inverse of ExceptT
.
withExcept :: (e -> e') -> Except e a -> Except e' a #
Transform any exceptions thrown by the computation using the given
function (a specialization of withExceptT
).
withExceptT :: forall (m :: Type -> Type) e e' a. Functor m => (e -> e') -> ExceptT e m a -> ExceptT e' m a #
Transform any exceptions thrown by the computation using the given function.
newtype ExceptT e (m :: Type -> Type) a #
A monad transformer that adds exceptions to other monads.
ExceptT
constructs a monad parameterized over two things:
- e - The exception type.
- m - The inner monad.
The return
function yields a computation that produces the given
value, while >>=
sequences two subcomputations, exiting on the
first exception.
Instances
except :: forall (m :: Type -> Type) e a. Monad m => Either e a -> ExceptT e m a #
Constructor for computations in the exception monad.
(The inverse of runExcept
).
transExcept :: forall t m e a. (MonadTransTunnel t, Applicative (Tunnel t), Monad m) => t (ExceptT e m) a -> t m (Either e a) Source #
Orphan instances
TransConstraint MonadFail (ExceptT e) Source # | |
TransConstraint MonadFix (ExceptT e) Source # | |
TransConstraint MonadIO (ExceptT e) Source # | |
TransConstraint Functor (ExceptT e) Source # | |
TransConstraint Monad (ExceptT e) Source # | |
Monoid e => TransConstraint MonadPlus (ExceptT e) Source # | |
TransConstraint MonadException (ExceptT e) Source # | |
hasTransConstraint :: forall (m :: Type -> Type). MonadException m => Dict (MonadException (ExceptT e m)) Source # | |
TransConstraint MonadInner (ExceptT e) Source # | |
hasTransConstraint :: forall (m :: Type -> Type). MonadInner m => Dict (MonadInner (ExceptT e m)) Source # | |
MonadTransCoerce (ExceptT e) Source # | |
MonadTransHoist (ExceptT e) Source # | |
MonadTransTunnel (ExceptT e) Source # | |
MonadException m => MonadException (ExceptT e m) Source # | |
MonadInner m => MonadInner (ExceptT e m) Source # | |
MonadCatch ex m => MonadCatch (Either e ex) (ExceptT e m) Source # | |
MonadThrow ex m => MonadThrow (Either e ex) (ExceptT e m) Source # | |