Idris2Doc : Control.Monad.Error.Interface

Control.Monad.Error.Interface

MonadError : Type -> (Type -> Type) -> Type
The strategy of combining computations that can throw exceptions
by bypassing bound functions
from the point an exception is thrown to the point that it is handled.
Is parameterized over the type of error information and
the monad type constructor.
It is common to use `Either String` as the monad type constructor
for an error monad in which error descriptions take the form of strings.
In that case and many other common cases the resulting monad is already defined
as an instance of the 'MonadError' class.
Parameters: e, m
Constraints: Monad m
Methods:
throwError : e -> ma
Is used within a monadic computation to begin exception processing.
catchError : ma -> (e -> ma) -> ma
A handler function to handle previous errors and return to normal execution.
A common idiom is:

```idris example
do { action1; action2; action3 } `catchError` handler
```

Implementations:
MonadErrorUnitMaybe
MonadErrore (Eithere)
Monadm => MonadErrore (EitherTem)
MonadErrorem => MonadErrore (MaybeTm)
MonadErrorem => MonadErrore (ReaderTrm)
MonadErrorem => MonadErrore (StateTrm)
MonadErrorem => MonadErrore (RWSTrwsm)
MonadErrorem => MonadErrore (WriterTwm)
catchError : MonadErrorem => ma -> (e -> ma) -> ma
A handler function to handle previous errors and return to normal execution.
A common idiom is:

```idris example
do { action1; action2; action3 } `catchError` handler
```
handleError : MonadErrorem => (e -> ma) -> ma -> ma
Flipped version of `catchError`.
liftEither : MonadErrorem => Eitherea -> ma
Lifts an `Either e` into any `MonadError e`.
mapError : (MonadErrorem, MonadErrore'n) => (m (Eitherea) -> n (Eithere'b)) -> ma -> nb
`MonadError` analogue of the `mapEitherT` function. The
computation is unwrapped, a function is applied to the `Either`, and
the result is lifted into the second `MonadError` instance.
throwError : MonadErrorem => e -> ma
Is used within a monadic computation to begin exception processing.
tryError : MonadErrorem => ma -> m (Eitherea)
Makes a success or failure of an action visible in
the return type.
withError : MonadErrorem => (e -> e) -> ma -> ma
`MonadError` analogue to the `withEitherT` function.
Modify the value (but not the type) of an error.
If you need to change the type of `e` use `mapError`.