fromPredicate()
fromPredicate<
A,E>(predicate,onFalse): (a) =>Either<E,A>
Creates an Either from a predicate.
Type Parametersβ
A: Aβ
The value type.
E: Eβ
The error type.
Parametersβ
predicate: (a) => booleanβ
The predicate function.
onFalse: (a) => Eβ
Function to create error when predicate fails.
Returnsβ
A function that creates an Either from a value.
Sinceβ
2.0.0