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

Control.Effect.Interpreter.Heftia.Output

Description

 
Synopsis

Documentation

runOutputEff :: (Freer c fr, Union u, HFunctor (u eh)) => (o -> Eff u fr eh r ()) -> Eff u fr eh (LOutput o ': r) ~> Eff u fr eh r Source #

ignoreOutput :: (Freer c fr, Union u, HFunctor (u eh), Applicative (Eff u fr eh r)) => Eff u fr eh (LOutput o ': r) ~> Eff u fr eh r Source #

runOutputList :: forall o a r fr u c. (Freer c fr, Union u, c (Eff u fr '[] r), c (StateT [o] (Eff u fr '[] r)), Applicative (Eff u fr '[] r), Monad (Eff u fr '[] (LState [o] ': r)), Member u (State [o]) (LState [o] ': r), HFunctor (u '[])) => Eff u fr '[] (LOutput o ': r) a -> Eff u fr '[] r ([o], a) Source #

runOutputMonoid :: forall o m a r fr u c. (Monoid m, Freer c fr, Union u, Monad (Eff u fr '[] r), c (WriterT m (Eff u fr '[] r)), HFunctor (u '[])) => (o -> m) -> Eff u fr '[] (LOutput o ': r) a -> Eff u fr '[] r (m, a) Source #

Run an Output effect by transforming into a monoid. The carrier is required to be a monad.

runOutputMonoidA :: forall o m a r fr u c. (Monoid m, Freer c fr, Union u, Applicative (Eff u fr '[] r), c (WriterT m (Eff u fr '[] r)), HFunctor (u '[])) => (o -> m) -> Eff u fr '[] (LOutput o ': r) a -> Eff u fr '[] r (m, a) Source #

Strict version of runOutputMonoid. The constraint on the carrier has been weakened to applicative.