Type classes for returning failures.
- class Monad f => Failure e f where
- failure :: e -> f v
- class Failure e f => WrapFailure e f where
- newtype StringException = StringException String
- failureString :: Failure StringException m => String -> m a
- class Try f where
- data NothingException = NothingException
- data NullException = NullException
Wrap the failure value, if any, with the given function. This is useful in particular when you want all the exceptions returned from a certain library to be of a certain type, even if they were generated by a different library.