:: Ord b => (a -> b) -> [a] -> a package:relude

The largest element of a non-empty data structure with respect to the given comparison function.
>>> maximumOn1 abs (0 :| [2, 1, -3, -2])
-3
The smallest element of a non-empty data structure with respect to the given comparison function.
>>> minimumOn1 abs (0 :| [2, 1, -3, -2])
0