max package:relude

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