maxBy method
Returns the element that gives the maximum value with respect to the specified comparison function.
Implementation
@override
Option<T> maxBy(int Function(T, T) f) {
T max;
if (moveNext()) {
max = current;
} else {
return None;
}
for (final element in this) {
if (f(element, max) > 0) {
max = element;
}
}
return Some(max);
}