LanguageExt.Core

LanguageExt.Core Traits Writable

Contents

class WritableExtensions Source #

Methods

method K<M, A> Pass <M, W, A> (this K<M, (A Value, Func<W, W> Function)> action) Source #

where M : Writable<M, W>
where W : Monoid<W>

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 #

where M : Writable<M, W>, Monad<M>
where W : Monoid<W>

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 #

where M : Writable<M, W>, Monad<M>
where W : Monoid<W>

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> Censor <M, W, A> (this K<M, A> ma, Func<W, W> f) Source #

where M : Writable<M, W>, Monad<M>
where W : Monoid<W>

censor executes the action ma and applies the function f to its output, leaving the return value unchanged.

method K<M, A> Censor <M, W, A> (this Func<W, W> f, K<M, A> ma) Source #

where M : Writable<M, W>, Monad<M>
where W : Monoid<W>

censor executes the action ma and applies the function f to its output, leaving the return value unchanged.

class Writable Source #

Methods

method K<M, Unit> tell <M, W> (W item) Source #

where M : Writable<M, W>
where W : Monoid<W>

Tell is an action that produces the writer output

Parameters

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 #

where M : Writable<M, W>, Monad<M>
where W : Monoid<W>

Writes an item and returns a value at the same time

method K<M, A> write <W, M, A> (A value, W item) Source #

where M : Writable<M, W>, Monad<M>
where W : Monoid<W>

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 #

where M : Writable<M, W>
where W : Monoid<W>

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 #

where M : Writable<M, W>
where W : Monoid<W>

Writes an item and returns a value at the same time

method K<M, (A Value, B Output)> listens <W, M, A, B> (Func<W, B> f, K<M, A> ma) Source #

where M : Writable<M, W>, Monad<M>
where W : Monoid<W>

listens executes the action ma and adds the result of applying f to the output to the value of the computation.

method K<M, A> censor <W, M, A> (Func<W, W> f, K<M, A> ma) Source #

where M : Writable<M, W>, Monad<M>
where W : Monoid<W>

censor executes the action ma and applies the function f to its output, leaving the return value unchanged.

interface Writable <M, W> Source #

where M : Writable<M, W>
where W : Monoid<W>

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.

Parameters

type M

Writer self trait

type W

Monoidal output type

Methods

method K<M, Unit> Tell (W item) Source #

Tell is an action that produces the writer output

Parameters

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.