A version of maximum where the comparison is done on some
extracted value. Raises an error if the list is empty. Only calls the
function once per element.
maximumOn id [] == undefined
maximumOn length ["test","extra","a"] == "extra"
A version of minimum where the comparison is done on some
extracted value. Raises an error if the list is empty. Only calls the
function once per element.
minimumOn id [] == undefined
minimumOn length ["test","extra","a"] == "a"