heftia-effects-0.3.1.0: higher-order effects done right
Copyright(c) 2023 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Control.Effect.Interpreter.Heftia.Except

Description

Interpreter and elaborator for the Throw / Catch effect classes.

Synopsis

Documentation

runExcept :: forall e a ef fr u c. (Member u (Throw e) (LThrow e ': ef), MonadFreer c fr, Union u, c (Eff u fr '[] (LThrow e ': ef)), c (ExceptT e (Eff u fr '[] (LThrow e ': ef))), HFunctor (u '[Catch e]), c (Eff u fr '[] ef), c (ExceptT e (Eff u fr '[] ef)), HFunctor (u '[])) => Eff u fr '[Catch e] (LThrow e ': ef) a -> Eff u fr '[] ef (Either e a) Source #

Interpret the Data.Effect.Except effects using the ExceptT monad transformer internally.

runCatch :: forall e ef fr u c. (Member u (Throw e) ef, MonadFreer c fr, Union u, c (Eff u fr '[] ef), c (ExceptT e (Eff u fr '[] ef)), HFunctor (u '[Catch e]), HFunctor (u '[])) => Eff u fr '[Catch e] ef ~> Eff u fr '[] ef Source #

Elaborate the Catch effect using the ExceptT monad transformer internally.

elabCatch :: forall e ef fr u c. (Member u (Throw e) ef, MonadFreer c fr, Union u, c (Eff u fr '[] ef), c (ExceptT e (Eff u fr '[] ef))) => Elab (Catch e) (Eff u fr '[] ef) Source #

elabCatchK :: forall e ef fr u c. (Member u (Throw e) ef, MonadFreer c fr, Union u, c (Eff u fr '[] ef)) => Elab (Catch e) (Eff u fr '[] ef) Source #

Elaborate the Catch effect using a delimited continuation.

runThrow :: forall e r a fr u c. (MonadFreer c fr, Union u, c (Eff u fr '[] r), c (ExceptT e (Eff u fr '[] r))) => Eff u fr '[] (LThrow e ': r) a -> Eff u fr '[] r (Either e a) Source #

Interpret the Throw effect using the ExceptT monad transformer.

runThrowT :: forall e r fr u c. (MonadFreer c fr, Union u, c (Eff u fr '[] r), c (ExceptT e (Eff u fr '[] r))) => Eff u fr '[] (LThrow e ': r) ~> ExceptT e (Eff u fr '[] r) Source #

Interpret the Throw effect using the ExceptT monad transformer.

runThrowK :: forall e r a fr u c. (MonadFreer c fr, Union u, c (Eff u fr '[] r)) => Eff u fr '[] (LThrow e ': r) a -> Eff u fr '[] r (Either e a) Source #

Interpret the Throw effect using a delimited continuation.

runThrowIO :: forall e eh ef fr c. (MonadFreer c fr, IO <| ef, ForallHFunctor eh, Exception e) => Eff fr eh (LThrow e ': ef) ~> Eff fr eh ef Source #

runCatchIO :: forall e eh ef fr c. (MonadFreer c fr, UnliftIO <<| eh, IO <| ef, ForallHFunctor eh, Exception e) => Eff fr (Catch e ': eh) ef ~> Eff fr eh ef Source #