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