← Back

Source

writer

Functor2<URI>

Added in v1.0.0 (instance)

Writer

constructor(readonly run: () => [A, W]) {}

Added in v1.0.0 (data)

eval

(): A

Added in v1.0.0 (method)

exec

(): W

Added in v1.0.0 (method)

map

<B>(f: (a: A) => B): Writer<W, B>

Added in v1.0.0 (method)

censor

<W, A>(fa: Writer<W, A>, f: (w: W) => W): Writer<W, A>

Added in v1.3.0 (function)

Modify the final accumulator value by applying a function

getMonad

<W>(M: Monoid<W>): Monad2C<URI, W>

Added in v1.0.0 (function)

listen

<W, A>(fa: Writer<W, A>): Writer<W, [A, W]>

Added in v1.3.0 (function)

Modifies the result to include the changes to the accumulator

listens

<W, A, B>(fa: Writer<W, A>, f: (w: W) => B): Writer<W, [A, B]>

Added in v1.3.0 (function)

Projects a value from modifications made to the accumulator during an action

pass

<W, A>(fa: Writer<W, [A, (w: W) => W]>): Writer<W, A>

Added in v1.3.0 (function)

Applies the returned function to the accumulator

tell

<W>(w: W): Writer<W, void>

Added in v1.0.0 (function)

Appends a value to the accumulator