maximumBy method

Option<T> maximumBy(
  1. Order<T> order
)

The largest element of this Iterable based on order.

If the list is empty, return None.

Implementation

Option<T> maximumBy(Order<T> order) => foldLeft(
    none(),
    (a, c) => some(
          a.match(
            () => c,
            (t) => order.compare(c, t) > 0 ? c : t,
          ),
        ));