Skip to main content

apS()

apS<N, A, E, B>(name, fb): (fa) => Either<E, { readonly [K in string | number | symbol]: K extends keyof A ? A[K] : B }>

Adds a value to the accumulated object in do notation.


Type Parameters​

N: N extends string​

The property name.

A: A extends Record<string, unknown>​

The accumulated type.

E: E​

The error type.

B: B​

The new value type.


Parameters​

name: Exclude<N, keyof A>​

The property name.

fb: Either<E, B>​

The Either containing the value.


Returns​

A function that adds the value.


Since​

2.0.0