find method

  1. @override
Option<T> find(
  1. bool f(
    1. T
    )
)

Searches for an element of an iterator that satisfies a predicate.

Implementation

@override
Option<T> find(bool Function(T) f) {
  for (final element in this) {
    if (f(element)) {
      return Some(element);
    }
  }
  return None;
}