eff-0.0.0.0
Safe HaskellNone
LanguageHaskell2010

Control.Effect.Writer

Synopsis

Documentation

data Writer w :: Effect where Source #

The Writer w effect allows the accumulation of monoidal values of type w.

Instances should obey the following laws:

Constructors

Tell :: w -> Writer w m () 
Listen :: Eff (Writer w ': effs) a -> Writer w (Eff effs) (w, a) 
Censor :: (w -> w) -> Eff (Writer w ': effs) a -> Writer w (Eff effs) a 

tell :: Writer w :< effs => w -> Eff effs () Source #

Appends the given value to the current output.

listen :: Writer w :< effs => Eff (Writer w ': effs) a -> Eff effs (w, a) Source #

Executes the given action and includes its output in the result.

censor :: Writer w :< effs => (w -> w) -> Eff (Writer w ': effs) a -> Eff effs a Source #

Executes the given action and modifies its output by applying the given function.