bluefin-algae-0.1.0.1: Algebraic effects and named handlers in Bluefin.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Bluefin.Algae.Exception.DynExn

Description

Exceptions as an algebraic effect

Variant of Bluefin.Algae.Exception that uses dynamic exceptions to cancel continuations.

Synopsis

Documentation

data Exception (e :: Type) :: AEffect where Source #

Exception interface.

Constructors

Throw :: e -> Exception e r

Throw an exception.

throw :: (ex :> zz, z :> zz) => Handler ex (Exception e) z -> e -> Eff zz a Source #

Throw an exception. Call the Throw operation.

catch :: forall e a ex zz. ex :> zz => DynExn ex -> (forall z. Handler ex (Exception e) z -> Eff (z :& zz) a) -> (e -> Eff zz a) -> Eff zz a Source #

Catch an exception.

try :: forall e a ex zz. ex :> zz => DynExn ex -> (forall z. Handler ex (Exception e) z -> Eff (z :& zz) a) -> Eff zz (Either e a) Source #

Return Either the exception or the result of the handled computation.