filter method

Option<T> filter(
  1. bool predicate(
    1. T self
    )
)

Implementation

@pragma("vm:prefer-inline")
Option<T> filter(bool Function(T self) predicate) {
  if (predicate(v)) {
    return Some(v);
  }
  return None;
}