bind()
bind<
N,A,E2,B>(name,f): <E1>(fa) =>Either<E2|E1, { readonly [K in string | number | symbol]: K extends keyof A ? A[K] : B }>
Binds a computed value to a name in do notation.
Type Parametersβ
N: N extends stringβ
The property name.
A: A extends Record<string, unknown>β
The accumulated type.
E2: E2β
The error type.
B: Bβ
The new value type.
Parametersβ
name: Exclude<N, keyof A>β
The property name.
f: (a) => Either<E2, B>β
The function to compute the value.
Returns: <E1>(fa): Either<E2 | E1, { readonly [K in string | number | symbol]: K extends keyof A ? A[K] : B }>β
A function that binds the computed value.
Sinceβ
2.0.0