Copyright | (c) 2023 Sayo Koyoneda |
---|---|
License | MPL-2.0 (see the LICENSE file) |
Maintainer | [email protected] |
Safe Haskell | None |
Language | GHC2021 |
Control.Monad.Hefty.Except
Description
Interpreters for the Except effects.
Synopsis
- runCatch :: forall e (ef :: [EffectF]). Throw e <| ef => Eff '[Catch e] ef ~> Eff ('[] :: [EffectH]) ef
- runExcept :: forall e (r :: [Type -> Type]) a. Eff '[Catch e] (Throw e ': r) a -> Eff ('[] :: [EffectH]) r (Either e a)
- runThrow :: forall e (r :: [Type -> Type]) a. Eff ('[] :: [EffectH]) (Throw e ': r) a -> Eff ('[] :: [EffectH]) r (Either e a)
- handleThrow :: forall e (r :: [EffectF]) a x. Throw e x -> (x -> Eff ('[] :: [EffectH]) r (Either e a)) -> Eff ('[] :: [EffectH]) r (Either e a)
- elabCatch :: forall e (ef :: [EffectF]). Throw e <| ef => Catch e ~~> Eff ('[] :: [EffectH]) ef
- runThrowIO :: forall e (eh :: [EffectH]) (ef :: [EffectF]). (IO <| ef, Exception e) => Eff eh (Throw e ': ef) ~> Eff eh ef
- runCatchIO :: forall e (eh :: [EffectH]) (ef :: [EffectF]). (UnliftIO <<| eh, IO <| ef, Exception e) => Eff (Catch e ': eh) ef ~> Eff eh ef
- module Data.Effect.Except
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 #
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.
module Data.Effect.Except