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

Control.Monad.Hefty.Output

Description

Interpreters for the Output effect.

Synopsis

Documentation

runOutputEff :: forall o (ef :: [EffectF]) (eh :: [EffectH]). (o -> Eff eh ef ()) -> Eff eh (Output o ': ef) ~> Eff eh ef Source #

Interprets the Output effect using the given output handler.

ignoreOutput :: forall o (ef :: [Type -> Type]) (eh :: [EffectH]) x. Eff eh (Output o ': ef) x -> Eff eh ef x Source #

Interprets the Output effect by ignoring the outputs.

runOutputList :: forall o a (ef :: [Type -> Type]). Eff ('[] :: [EffectH]) (Output o ': ef) a -> Eff ('[] :: [EffectH]) ef ([o], a) Source #

Interprets the Output effect by accumulating the outputs into a list.

runOutputMonoid :: forall o w a (ef :: [Type -> Type]). Monoid w => (o -> w) -> Eff ('[] :: [EffectH]) (Output o ': ef) a -> Eff ('[] :: [EffectH]) ef (w, a) Source #

Interprets the Output effect by accumulating the outputs into a monoid.