fromPredicate()
fromPredicate<
A,E>(predicate,onFalse): (a) =>TaskEither<E,A>
Creates a TaskEither 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 a TaskEither.
Sinceโ
2.0.0