fromPredicate<A> function

TaskOption<A> fromPredicate<A>(
  1. A value,
  2. bool predicate(
    1. A value
    )
)

Returns a Some or None if the predicate returns true or false respectively.

Implementation

TaskOption<A> fromPredicate<A>(
  A value,
  bool Function(A value) predicate,
) =>
    TaskOption(T.value(O.fromPredicate(value, predicate)));