/** * Construct `Either` by applying a predicate to `A` and constructing * `E` if the predicate is `false`. * * @tsplus static Either.Ops fromPredicate */ export function fromPredicate( a: A, f: Refinement, onFalse: (a: A) => E ): Either export function fromPredicate( a: A, f: Predicate, onFalse: (a: A) => E ): Either export function fromPredicate( a: A, f: Predicate, onFalse: (a: A) => E ): Either { return f(a) ? Either.right(a) : Either.left(onFalse(a)) }