HORIZON HASKELLDocslts/ghc-10.0.xc7d136e2026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · c7d136e · 2026-10-12

Moduleresourcet-1.3.0

Control.Monad.Trans.Resource

  • 7 types
  • 3 classes
  • 17 values
classclass Monad m => MonadThrow (m :: Type -> Type) where
#

A class for monads in which exceptions may be thrown.

Instances should obey the following law:

throwM e >> x = throwM e

In other words, throwing an exception short-circuits the rest of the monadic computation.

Methods

  • throwM :: (HasCallStack, Exception e) => e -> m a

    Throw 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
Instances21MonadThrow, …
classclass MonadIO m => MonadResource (m :: Type -> Type) where
#

Methods

Instances12MonadResource, …
newtypenewtype ResourceT (m :: Type -> Type) a
#
Instances22MonadTrans, MonadRWS, MonadError, MonadReader, MonadState, MonadWriter, …