HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Moduleextensible-effects-5.0.0.1Haskell2010

Control.Eff.Exception

Exception-producing and exception-handling effects

  • 2 types
  • 15 values
newtypenewtype Exc e (v :: k)
#

Exceptions

exceptions of the type e; no resumption

Constructors

Instances3MonadBaseControl, Handle, StM
valuethrowError :: Member (Exc e) r => e -> Eff r a
#

Throw an exception in an effectful computation. The type is inferred.

valuethrowError_ :: Member (Exc e) r => e -> Eff r ()
#

Throw an exception in an effectful computation. The type is unit, which suppresses the ghc-mod warning "A do-notation statement discarded a result of type"

valuedie :: Member Fail r => Eff r a
#

Makes an effect fail, preventing future effects from happening.

valuecatchError :: Member (Exc e) r => Eff r a -> (e -> Eff r a) -> Eff r a
#

Run a computation that might produce exceptions, and give it a way to deal with the exceptions that come up. The handler is allowed to rethrow the exception

valueonFail
  1. :: Eff (Fail ': r) a

    The fallible computation.

  2. -> Eff r a

    The computation to run on failure.

  3. -> Eff r a
#

Add a default value (i.e. failure handler) to a fallible computation. This hides the fact that a failure happened.

valuerethrowError
  1. :: Member (Exc e') r
  2. => e -> e'
  3. -> Eff (Exc e ': r) a
  4. -> Eff r a
#

Run a computation until it produces an exception, and convert and throw that exception in a new context.

valueignoreFail :: Eff (Fail ': r) a -> Eff r ()
#

Ignores a failure event. Since the event can fail, you cannot inspect its return type, because it has none on failure. To inspect it, use runFail.