Skip to content

bind

bind<K, R, A, B>(key, f): (data) => Reader<R, A & { [P in string]: B }>

Defined in: Core/Reader.ts:194

Evaluates a new Reader using the current accumulator and attaches the output to a new key.

K extends string

R

A

B

K

(a) => Reader<R, B>

(data) => Reader<R, A & { [P in string]: B }>

pipe(
  Reader.resolve({ a: 1 }),
  Reader.bind("b", ({ a }) => Reader.resolve(a + 1))
); // Reader({ a: 1, b: 2 })