fromPredicate<S, C, L, R> function

StateReaderTaskEither<S, C, L, R> fromPredicate<S, C, L, R>(
  1. R r,
  2. bool f(
    1. R r
    ),
  3. L orElse(
    1. R r
    )
)

If the function returns true, then the resolved Either will be a Right containing the given value.

If the function returns false, then the resolved Either will be a Left containing the value returned from executing the orElse function.

Implementation

StateReaderTaskEither<S, C, L, R> fromPredicate<S, C, L, R>(
  R r,
  bool Function(R r) f,
  L Function(R r) orElse,
) =>
    fromEither(Ei.fromPredicate(r, f, orElse));