The largest element of a non-empty structure. This function is
equivalent to
bifoldr1 max, and its behavior on
structures with multiple largest elements depends on the relevant
implementation of
max. For the default implementation of
max (
max x y = if x <= y then y else x), structure
order is used as a tie-breaker: if there are multiple largest
elements, the rightmost of them is chosen (this is equivalent to
bimaximumBy compare).
Examples
Basic usage:
>>> bimaximum (42, 17)
42
>>> bimaximum (Right 42)
42
>>> bimaximum (BiList [13, 29, 4] [18, 1, 7])
29
>>> bimaximum (BiList [13, 29, 4] [])
29
On empty structures, this function throws an exception:
>>> bimaximum (BiList [] [])
*** Exception: bimaximum: empty structure
...