fromPredicate
fromPredicate<
E,A>(pred,onFalse): (a) =>Result<E,A>
Defined in: Core/Result.ts:202
Creates a Result from a predicate applied to a value. Returns Ok if the predicate passes, Err from onFalse otherwise.
Type Parameters
Section titled “Type Parameters”E
A
Parameters
Section titled “Parameters”(a) => boolean
onFalse
Section titled “onFalse”(a) => E
Returns
Section titled “Returns”(a) => Result<E, A>