heftia-effects-0.4.0.0: higher-order effects done right
Copyright(c) 2023 Sayo Koyoneda
LicenseMPL-2.0 (see the LICENSE file)
Maintainerymdfield@outlook.jp
Portabilityportable
Safe HaskellNone
LanguageGHC2021

Control.Monad.Hefty.Except

Description

Interpreters for the Throw / Catch effects.

Documentation

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

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

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

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

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

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

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

prog' :: Eff ('[] :: [EffectH]) '[Throw String, Throw Int] () Source #