fromPredicateK<T> function

Option<T> Function(T value) fromPredicateK<T>(
  1. bool predicate(
    1. T value
    )
)

Wrapper around fromPredicate that can be curried with the value.

final greaterThanTwo = fromPredicateK((int i) => i > 2);

expect(greaterThanTwo(3), some(3));
expect(greaterThanTwo(1), none());

Implementation

Option<T> Function(T value) fromPredicateK<T>(
  bool Function(T value) predicate,
) =>
    (value) => fromPredicate(value, predicate);