← Back

Source

reader

Monad2<URI>

Added in v1.0.0 (instance)

Reader

constructor(readonly run: (e: E) => A) {}

Added in v1.0.0 (data)

ap

<B>(fab: Reader<E, (a: A) => B>): Reader<E, B>

Added in v1.0.0 (method)

ap_

<B, C>(this: Reader<E, (b: B) => C>, fb: Reader<E, B>): Reader<E, C>

Added in v1.0.0 (method)

Flipped version of ap

chain

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

Added in v1.0.0 (method)

local

<E2 = E>(f: (e: E2) => E): Reader<E2, A>

Added in v1.6.1 (method)

map

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

Added in v1.0.0 (method)

ask

<E>(): Reader<E, E>

Added in v1.0.0 (function)

reads the current context

asks

<E, A>(f: (e: E) => A): Reader<E, A>

Added in v1.0.0 (function)

Projects a value from the global context in a Reader

local

<E, E2 = E>(f: (e: E2) => E) => <A>(fa: Reader<E, A>): Reader<E2, A>

Added in v1.0.0 (function)

changes the value of the local context during the execution of the action fa