max package:rio

O(n) maximum returns the maximum value from a ByteString
O(n) maximum returns the maximum value from a ByteString An exception will be thrown in the case of an empty ByteString.
The largest element of a non-empty structure. This function is non-total and will raise a runtime exception if the structure happens to be empty. A structure that supports random access and maintains its elements in order should provide a specialised implementation to return the maximum in faster than linear time.

Examples

Basic usage:
>>> maximum [1..10]
10
>>> maximum []
*** Exception: Prelude.maximum: empty list
>>> maximum Nothing
*** Exception: maximum: empty structure
WARNING: This function is partial for possibly-empty structures like lists.
The largest element of a non-empty structure with respect to the given comparison function.

Examples

Basic usage:
>>> maximumBy (compare `on` length) ["Hello", "World", "!", "Longest", "bar"]
"Longest"
WARNING: This function is partial for possibly-empty structures like lists.
Retrieves the value associated with maximal key of the map, and the map stripped of that element, or Nothing if passed an empty map.
maxView (fromList [(5,"a"), (3,"b")]) == Just ("a", singleton 3 "b")
maxView empty == Nothing
Retrieves the maximal (key,value) pair of the map, and the map stripped of that element, or Nothing if passed an empty map.
maxViewWithKey (fromList [(5,"a"), (3,"b")]) == Just ((5,"a"), singleton 3 "b")
maxViewWithKey empty == Nothing
Retrieves the maximal key of the set, and the set stripped of that element, or Nothing if passed an empty set.
O(n) maximum returns the maximum value from a Text, which must be non-empty.