Safe Haskell | None |
---|---|
Language | Haskell98 |
Error monad transformer and monad type classes for raising errors and recovering from them.
- class (Applicative μ, Monad μ) => MonadAbort e μ | μ -> e where
- class MonadAbort e μ => MonadRecover e μ | μ -> e where
- onError :: MonadRecover e μ => μ α -> (e -> μ β) -> μ α
- onError_ :: MonadRecover e μ => μ α -> μ β -> μ α
- type Abort e α = AbortT e Identity α
- runAbort :: Abort e α -> Either e α
- newtype AbortT e (μ :: * -> *) α :: * -> (* -> *) -> * -> * = AbortT {}
- module Control.Monad
- module Control.Monad.Fix
- module Control.Monad.Trans
Documentation
class (Applicative μ, Monad μ) => MonadAbort e μ | μ -> e where Source #
Class of monads that support raising of errors.
class MonadAbort e μ => MonadRecover e μ | μ -> e where Source #
Class of monads that support recovery from errors.
onError :: MonadRecover e μ => μ α -> (e -> μ β) -> μ α Source #
Run an action on error, without recovering from it.
onError_ :: MonadRecover e μ => μ α -> μ β -> μ α Source #
Run an action on error (ignoring the error value), without recovering from it.
newtype AbortT e (μ :: * -> *) α :: * -> (* -> *) -> * -> * #
A monad transformer that extends monad μ
with the ability
to raise errors of type e
and to recover from them.
module Control.Monad
module Control.Monad.Fix
module Control.Monad.Trans