minimumBy method

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

The least element of this Iterable based on order.

If the list is empty, return None.

Implementation

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