Table of contents


Writer (interface)

Signature

export interface Writer<W, A> {
  (): [A, W]
}

Added in v2.0.0

URI (type alias)

Signature

export type URI = typeof URI

Added in v2.0.0

URI (constant)

Signature

export const URI: "Writer" = ...

Added in v2.0.0

writer (constant)

Signature

export const writer: Functor2<URI> = ...

Added in v2.0.0

censor (function)

Modify the final accumulator value by applying a function

Signature

export function censor<W>(f: (w: W) => W): <A>(fa: Writer<W, A>) => Writer<W, A> { ... }

Added in v2.0.0

evalWriter (function)

Signature

export function evalWriter<W, A>(fa: Writer<W, A>): A { ... }

Added in v2.0.0

execWriter (function)

Signature

export function execWriter<W, A>(fa: Writer<W, A>): W { ... }

Added in v2.0.0

getMonad (function)

Signature

export function getMonad<W>(M: Monoid<W>): Monad2C<URI, W> { ... }

Added in v2.0.0

listen (function)

Modifies the result to include the changes to the accumulator

Signature

export function listen<W, A>(fa: Writer<W, A>): Writer<W, [A, W]> { ... }

Added in v2.0.0

listens (function)

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

Signature

export function listens<W, B>(f: (w: W) => B): <A>(fa: Writer<W, A>) => Writer<W, [A, B]> { ... }

Added in v2.0.0

pass (function)

Applies the returned function to the accumulator

Signature

export function pass<W, A>(fa: Writer<W, [A, (w: W) => W]>): Writer<W, A> { ... }

Added in v2.0.0

tell (function)

Appends a value to the accumulator

Signature

export function tell<W>(w: W): Writer<W, void> { ... }

Added in v2.0.0

map (export)

Signature

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

Added in v2.0.0