effet-0.2.0.0: An Effect System based on Type Classes
Copyright(c) Michael Szvetits 2020
LicenseBSD3 (see the file LICENSE)
Maintainertypedbyte@qualified.name
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Control.Effect.Writer.Lazy

Description

Lazy interpretations of the Writer' effect.

If you don't require disambiguation of multiple writer effects (i.e., you only have one writer effect in your monadic context), you usually need the untagged interpretations.

Synopsis

Tagged Interpretations

execWriter' Source #

Arguments

:: forall tag w m a. Monad m 
=> (Writer' tag w `Via` WriterT w) m a

The program whose writer effect should be handled.

-> m w

The program with its writer effect handled, producing the final output w.

Runs the writer effect and returns the final output.

runWriter' Source #

Arguments

:: forall tag w m a. Functor m 
=> (Writer' tag w `Via` WriterT w) m a

The program whose writer effect should be handled.

-> m (w, a)

The program with its writer effect handled, producing the final output w and the result a.

Runs the writer effect and returns both the final output and the result of the interpreted program.

Untagged Interpretations

execWriter :: Monad m => (Writer w `Via` WriterT w) m a -> m w Source #

The untagged version of execWriter'.

runWriter :: Functor m => (Writer w `Via` WriterT w) m a -> m (w, a) Source #

The untagged version of runWriter'.