Copyright | (c) 2023 Sayo Koyoneda |
---|---|
License | MPL-2.0 (see the LICENSE file) |
Maintainer | [email protected] |
Safe Haskell | None |
Language | GHC2021 |
Control.Monad.Hefty.Writer
Description
Interpreters for the Writer effects.
Synopsis
- runWriterPost :: forall w (ef :: [Type -> Type]) a. Monoid w => Eff '[WriterH w] (Tell w ': ef) a -> Eff ('[] :: [EffectH]) ef (w, a)
- handleTell :: forall w (ef :: [EffectF]) a. Monoid w => StateInterpreter w (Tell w) (Eff ('[] :: [EffectH]) ef) (w, a)
- runTell :: forall w (ef :: [Type -> Type]) a. Monoid w => Eff ('[] :: [EffectH]) (Tell w ': ef) a -> Eff ('[] :: [EffectH]) ef (w, a)
- runWriterHPost :: forall w (ef :: [EffectF]). (Monoid w, Tell w <| ef) => Eff '[WriterH w] ef ~> Eff ('[] :: [EffectH]) ef
- runWriterPre :: forall w (ef :: [Type -> Type]) a. Monoid w => Eff '[WriterH w] (Tell w ': ef) a -> Eff ('[] :: [EffectH]) ef (w, a)
- runWriterHPre :: forall w (ef :: [EffectF]). (Monoid w, Tell w <| ef) => Eff '[WriterH w] ef ~> Eff ('[] :: [EffectH]) ef
- intercept :: forall w (ef :: [EffectF]) a. (Tell w <| ef, Monoid w) => Eff ('[] :: [EffectH]) ef a -> Eff ('[] :: [EffectH]) ef (w, a)
- censorPost :: forall w (ef :: [EffectF]). (Tell w <| ef, Monoid w) => (w -> w) -> Eff ('[] :: [EffectH]) ef ~> Eff ('[] :: [EffectH]) ef
- censorPre :: forall w (eh :: [EffectH]) (ef :: [EffectF]). (Tell w <| ef, Monoid w) => (w -> w) -> Eff eh ef ~> Eff eh ef
- confiscate :: forall w (ef :: [EffectF]) a. (Tell w <| ef, Monoid w) => Eff ('[] :: [EffectH]) ef a -> Eff ('[] :: [EffectH]) ef (w, a)
- module Data.Effect.Writer
Documentation
runWriterPost :: forall w (ef :: [Type -> Type]) a. Monoid w => Eff '[WriterH w] (Tell w ': ef) a -> Eff ('[] :: [EffectH]) ef (w, a) Source #
Interpret the Writer effects with post-applying censor semantics.
handleTell :: forall w (ef :: [EffectF]) a. Monoid w => StateInterpreter w (Tell w) (Eff ('[] :: [EffectH]) ef) (w, a) Source #
A handler function for the Tell
effect.
runTell :: forall w (ef :: [Type -> Type]) a. Monoid w => Eff ('[] :: [EffectH]) (Tell w ': ef) a -> Eff ('[] :: [EffectH]) ef (w, a) Source #
Interpret the Tell
effect.
runWriterHPost :: forall w (ef :: [EffectF]). (Monoid w, Tell w <| ef) => Eff '[WriterH w] ef ~> Eff ('[] :: [EffectH]) ef Source #
Interpret the WriterH
effect with post-applying censor semantics.
runWriterPre :: forall w (ef :: [Type -> Type]) a. Monoid w => Eff '[WriterH w] (Tell w ': ef) a -> Eff ('[] :: [EffectH]) ef (w, a) Source #
Interpret the Writer effects with pre-applying censor semantics.
runWriterHPre :: forall w (ef :: [EffectF]). (Monoid w, Tell w <| ef) => Eff '[WriterH w] ef ~> Eff ('[] :: [EffectH]) ef Source #
Interpret the WriterH
effect with pre-applying censor semantics.
intercept :: forall w (ef :: [EffectF]) a. (Tell w <| ef, Monoid w) => Eff ('[] :: [EffectH]) ef a -> Eff ('[] :: [EffectH]) ef (w, a) Source #
censorPost :: forall w (ef :: [EffectF]). (Tell w <| ef, Monoid w) => (w -> w) -> Eff ('[] :: [EffectH]) ef ~> Eff ('[] :: [EffectH]) ef Source #
censor
with post-applying semantics.
censorPre :: forall w (eh :: [EffectH]) (ef :: [EffectF]). (Tell w <| ef, Monoid w) => (w -> w) -> Eff eh ef ~> Eff eh ef Source #
censor
with pre-applying semantics.
confiscate :: forall w (ef :: [EffectF]) a. (Tell w <| ef, Monoid w) => Eff ('[] :: [EffectH]) ef a -> Eff ('[] :: [EffectH]) ef (w, a) Source #
Consumes all the tell
effects from the specified Tell w
slot within the
given action and returns the accumulated monoidal value along with the result.
module Data.Effect.Writer