option<T> function

Option<T> option<T>(
  1. T value,
  2. bool predicate(
    1. T
    )
)

Return Some of value when predicate applied to value returns true, None otherwise.

Same as initializing Option.fromPredicate(value, predicate).

Implementation

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