writer -is:module
writer (a,w) embeds a simple writer action.
Construct a writer computation from a (result, output) pair.
Construct a writer computation from a (result, output) pair.
Construct a writer computation from a (result, output) pair. (The
inverse of
runWriter.)
Construct a writer computation from a (result, output) pair. (The
inverse of
runWriter.)
Like
write but uses the experimental
Refold API.
Internal
Pretty print the supplied argument and write the resultant text to
stdout. This will pass the detected terminal width to the
render function, resulting in appopriate line wrapping when
rendering your value.
Construct a writer computation from a (result, output) pair.
Construct a writer computation from a (result, output) pair. (The
inverse of
runWriter.)
writer @tag (a, w) lifts a pure writer action (a, w)
to a monadic action in an arbitrary monad m with capability
HasWriter.
Appends w to the output of the writer capability tag
and returns the value a.
A writer monad parameterized by the type
w of output to
accumulate.
The
return function produces the output
mempty, while
>>= combines the outputs of the subcomputations using
mappend.
A writer monad parameterized by the type
w of output to
accumulate.
The
return function produces the output
mempty, while
>>= combines the outputs of the subcomputations using
mappend.
A writer monad parameterized by the type
w of output to
accumulate.
The
return function produces the output
mempty, while
m >>= k combines the outputs of the
subcomputations using
mappend (also known as
<>):
An effect capable of emitting and intercepting messages.
Provide access to a write only value of type w.
Provide access to a strict (WHNF), thread local, write only value of
type w.
Provide access to a strict (WHNF), shared, write only value of type
w.
The Writer monad
In MTL's Writer monad, the told value must have a |Monoid| type. Our
writer has no such constraints. If we write a |Writer|-like
interpreter to accumulate the told values in a monoid, it will have
the |Monoid w| constraint then
Writer effects - send outputs to an effect environment.
An effect capable of emitting and intercepting messages.