Copyright | (c) Ivan Lazar Miljenovic |
---|---|
License | 3-Clause BSD-style |
Maintainer | Ivan.Miljenovic@gmail.com |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Computations which may fail or throw exceptions.
- throwError :: forall e m a. HasError e m => e -> m a
- catchError :: forall e m a. HasError e m => m a -> (e -> m a) -> m a
- newtype ExceptT e m a :: * -> (* -> *) -> * -> * = ExceptT (m (Either e a))
- type HasError e m = SatisfyConstraint (IsError e) m
- class MonadTower m => IsError e m
Documentation
throwError :: forall e m a. HasError e m => e -> m a Source
Begin exception processing.
catchError :: forall e m a. HasError e m => m a -> (e -> m a) -> m a Source
Handle exception processing.
newtype ExceptT e m 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.
type HasError e m = SatisfyConstraint (IsError e) m Source
A monad stack that can throw and handle exceptions of type e
.
class MonadTower m => IsError e m Source
Constraint for monads that can throw and handle exceptions.
IsError IOException IO | |
IsError e (Either e) | |
MonadTower m => IsError e (ExceptT e m) | |
ValidConstraint (IsError e) | |
MonadTower m => ConstraintPassThrough (IsError e) (ListT m) True | |
type ConstraintSatisfied (IsError e) m |