findMapOpt<U> method

  1. @override
Option<U> findMapOpt<U>(
  1. Option<U> f(
    1. T
    )
)

Applies the function to the elements of iterator and returns the first non-(none/null) result.

Implementation

@override
Option<U> findMapOpt<U>(Option<U> Function(T) f) {
  for (final element in this) {
    final result = f(element);
    if (result.isSome()) {
      return result;
    }
  }
  return None;
}