heftia-effects-0.5.0.0: higher-order algebraic effects done right
Copyright(c) 2023 Sayo Koyoneda
LicenseMPL-2.0 (see the LICENSE file)
Maintainer[email protected]
Safe HaskellNone
LanguageGHC2021

Control.Monad.Hefty.Except

Description

Interpreters for the Except effects.

Synopsis

Documentation

runCatch :: forall e (ef :: [EffectF]). Throw e <| ef => Eff '[Catch e] ef ~> Eff ('[] :: [EffectH]) ef Source #

Interpret the Catch effect.

runExcept :: forall e (r :: [Type -> Type]) a. Eff '[Catch e] (Throw e ': r) a -> Eff ('[] :: [EffectH]) r (Either e a) Source #

Interpret the Throw/Catch effects.

runThrow :: forall e (r :: [Type -> Type]) a. Eff ('[] :: [EffectH]) (Throw e ': r) a -> Eff ('[] :: [EffectH]) r (Either e a) Source #

Interpret the Throw effect.

handleThrow :: forall e (r :: [EffectF]) a x. Throw e x -> (x -> Eff ('[] :: [EffectH]) r (Either e a)) -> Eff ('[] :: [EffectH]) r (Either e a) Source #

A handler function for the Throw effect.

elabCatch :: forall e (ef :: [EffectF]). Throw e <| ef => Catch e ~~> Eff ('[] :: [EffectH]) ef Source #

A elaborator function for the Catch effect.

runThrowIO :: forall e (eh :: [EffectH]) (ef :: [EffectF]). (IO <| ef, Exception e) => Eff eh (Throw e ': ef) ~> Eff eh ef Source #

Interpret the Throw effect based on an IO-fused semantics using IO-level exceptions.

runCatchIO :: forall e (eh :: [EffectH]) (ef :: [EffectF]). (UnliftIO <<| eh, IO <| ef, Exception e) => Eff (Catch e ': eh) ef ~> Eff eh ef Source #

Interpret the Catch effect based on an IO-fused semantics using IO-level exceptions.