Type classes for returning failures.
- class Monad f => Failure e f where
- failure :: e -> f v
- class Failure e f => WrapFailure e f where
- wrapFailure :: (forall eIn. Exception eIn => eIn -> e) -> f a -> f a
- newtype StringException = StringException String
- failureString :: Failure StringException m => String -> m a
- class Try f where
- data NothingException = NothingException
- data NullException = NullException
Type class
Wrapping failures
class Failure e f => WrapFailure e f whereSource
wrapFailure :: (forall eIn. Exception eIn => eIn -> e) -> f a -> f aSource
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.
Exception e => WrapFailure e IO |
Convenience String
failure
newtype StringException Source
failureString :: Failure StringException m => String -> m aSource
Convert Failure
s into concrete types
data NothingException Source