Error +Control.Monad.Trans +transformers
This monad transformer adds the ability to fail or throw exceptions to a monad.
A sequence of actions succeeds, producing a value, only if all the actions in the sequence are successful. If one fails with an error, the rest of the sequence is skipped and the composite action fails with that error.
If the value of the error is not required, the variant in Control.Monad.Trans.Maybe may be used instead.
An exception to be thrown.
Minimal complete definition: noMsg or strMsg.
Workaround so that we can have a Haskell 98 instance Error String.
The error monad transformer. It can be used to add error handling to other monads.
The ErrorT Monad structure is parameterized over two things:
* e - The error type.
* m - The inner monad.
The return function yields a successful computation, while >>= sequences two subcomputations, failing on the first error.
Map the unwrapped computation using the given function.
* (mapErrorT f m) = f (runErrorT