minimumBy package:universum

The least element of a NonEmpty with respect to the given comparison function.
The least element of a non-empty structure with respect to the given comparison function.

Examples

Basic usage:
>>> minimumBy (compare `on` length) ["Hello", "World", "!", "Longest", "bar"]
"!"
WARNING: This function is partial for possibly-empty structures like lists.