A class for monads in which exceptions may be thrown.
Instances should obey the following law:
throwM e >> x = throwM eIn other words, throwing an exception short-circuits the rest of the monadic computation.
Methods
throwM :: (HasCallStack, Exception e) => e -> m aThrow an exception. Note that this throws when this action is run in the monad
m, not when it is applied. It is a generalization of Control.Exception's throwIO.Should satisfy the law:
throwM e >> f = throwM e
Instances19MonadThrow, …
MonadThrow STMDefined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow MaybeDefined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow IODefined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow QDefined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow []Defined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow (ST s)Defined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow m => MonadThrow (MaybeT m)Defined in exceptions-0.10.9 · Control.Monad.CatchThrows exceptions into the base monad.
Monad m => MonadThrow (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.Puree ~ SomeException => MonadThrow (Either e)Defined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow m => MonadThrow (ExceptT e m)Defined in exceptions-0.10.9 · Control.Monad.CatchThrows exceptions into the base monad.
MonadThrow m => MonadThrow (IdentityT m)Defined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow m => MonadThrow (ReaderT r m)Defined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow m => MonadThrow (StateT s m)Defined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow m => MonadThrow (StateT s m)Defined in exceptions-0.10.9 · Control.Monad.Catch(MonadThrow m, Monoid w) => MonadThrow (WriterT w m)Defined in exceptions-0.10.9 · Control.Monad.Catch(MonadThrow m, Monoid w) => MonadThrow (WriterT w m)Defined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow m => MonadThrow (ContT r m)Defined in exceptions-0.10.9 · Control.Monad.Catch(MonadThrow m, Monoid w) => MonadThrow (RWST r w s m)Defined in exceptions-0.10.9 · Control.Monad.Catch(MonadThrow m, Monoid w) => MonadThrow (RWST r w s m)Defined in exceptions-0.10.9 · Control.Monad.Catch