- WritableExtensions
- Pass <M, W, A> (this K<M, (A Value, Func<W, W> Function)> action)
- Listens <M, W, A, B> (this Func<W, B> f, K<M, A> ma)
- Listens <M, W, A, B> (this K<M, A> ma, Func<W, B> f)
- Censor <M, W, A> (this K<M, A> ma, Func<W, W> f)
- Censor <M, W, A> (this Func<W, W> f, K<M, A> ma)
- Writable
- tell <M, W> (W item)
- write <W, M, A> ((A, W) item)
- write <W, M, A> (A value, W item)
- pass <W, M, A> (K<M, (A Value, Func<W, W> Function)> action)
- listen <W, M, A> (K<M, A> ma)
- listens <W, M, A, B> (Func<W, B> f, K<M, A> ma)
- censor <W, M, A> (Func<W, W> f, K<M, A> ma)
- Writable <M, W>
class WritableExtensions Source #
method K<M, A> Pass <M, W, A> (this K<M, (A Value, Func<W, W> Function)> action) Source #
pass
is an action that executes the action
, which returns a value and a
function; it then returns the value with the output having been applied to
the function.
method K<M, (A Value, B Output)> Listens <M, W, A, B> (this Func<W, B> f, K<M, A> ma) Source #
listens
executes the action @m@ and adds the result of applying f
to the
output to the value of the computation.
method K<M, (A Value, B Output)> Listens <M, W, A, B> (this K<M, A> ma, Func<W, B> f) Source #
listens
executes the action @m@ and adds the result of applying f
to the
output to the value of the computation.
method K<M, Unit> tell <M, W> (W item) Source #
Tell is an action that produces the writer output
type | W | Writer type |
param | item | Item to tell |
returns | Structure with the told item |
method K<M, A> write <W, M, A> ((A, W) item) Source #
Writes an item and returns a value at the same time
method K<M, A> write <W, M, A> (A value, W item) Source #
Writes an item and returns a value at the same time
method K<M, A> pass <W, M, A> (K<M, (A Value, Func<W, W> Function)> action) Source #
pass
is an action that executes the action
, which returns a value and a
function; it then returns the value with the output having been applied to
the function.
method K<M, (A Value, W Output)> listen <W, M, A> (K<M, A> ma) Source #
Writes an item and returns a value at the same time
interface Writable <M, W> Source #
WriterM trait
Tell
is how you log to the writer's output. The WriterM
carries
this 'packet' upwards, merging it if needed (hence the Monoid
requirement).
Listen
listens to a monad acting, and returns what the monad "said".
Pass
lets you provide a writer transformer which changes internals of
the written object.
type | M | Writer self trait |
type | W | Monoidal output type |
method K<M, Unit> Tell (W item) Source #
Tell is an action that produces the writer output
type | W | Writer type |
param | item | Item to tell |
returns | Structure with the told item |
method K<M, (A Value, W Output)> Listen <A> (K<M, A> ma) Source #
Writes an item and returns a value at the same time
method K<M, A> Pass <A> (K<M, (A Value, Func<W, W> Function)> action) Source #
Pass
is an action that executes the action
, which returns a value and a
function; it then returns the value with the output having been applied to
the function.
For usage, see Writer.censor
for how it's used to filter the output.