control-monad-failure-0.4: A class for monads which can fail with an error.Source codeContentsIndex
Control.Monad.Failure.Class
Description
Defines the class MonadFailure for monads which can fail.
Synopsis
class Monad m => MonadFailure e m where
failure :: e -> m a
class MonadFailure e m => WrapFailure e m where
wrapFailure :: (forall eIn. Exception eIn => eIn -> e) -> m a -> m a
failureString :: MonadFailure StringException m => String -> m a
newtype StringException = StringException String
Documentation
class Monad m => MonadFailure e m whereSource
Methods
failure :: e -> m aSource
show/hide Instances
class MonadFailure e m => WrapFailure e m whereSource
Methods
wrapFailure :: (forall eIn. Exception eIn => eIn -> e) -> m a -> m 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.
show/hide Instances
failureString :: MonadFailure StringException m => String -> m aSource
Call failure with a String.
newtype StringException Source
Constructors
StringException String
show/hide Instances
Produced by Haddock version 2.6.0