max -package:base
O(n) maximum returns the maximum value from a
ByteString An exception will be thrown in the case of an empty
ByteString.
O(n) maximum returns the maximum value from a
Text, which must be non-empty.
O(n) maximum returns the maximum value from a stream, which
must be non-empty.
Properties
maximum . stream = maximum
Retrieves the maximal key of the map, and the map
stripped of that element, or
Nothing if passed an empty map.
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.
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.
Maximum number of discarded tests per successful test before giving up
Maximum number of shrinks to do before giving up. Setting this to zero
turns shrinking off.
Size to use for the biggest test cases
Maximum number of successful tests before succeeding. Testing stops at
the first failure. If all tests are passing and you want to run more
tests, increase this number.
Number of tests to execute
O(n) Yield the index of the maximum element of the vector. The
vector may not be empty.
O(n) Yield the index of the maximum element of the vector
according to the given comparison function. The vector may not be
empty. In case of a tie, the first occurrence wins.
Examples
>>> import Data.Ord
>>> import qualified Data.Vector as V
>>> V.maxIndexBy (comparing fst) $ V.fromList [(2,'a'), (1,'b')]
0
>>> V.maxIndexBy (comparing fst) $ V.fromList [(1,'a'), (1,'b')]
0
O(n) Yield the maximum element of the vector. The vector may
not be empty. In case of a tie, the first occurrence wins.
Examples
>>> import qualified Data.Vector as V
>>> V.maximum $ V.fromList [2, 1]
2
>>> import Data.Semigroup
>>> V.maximum $ V.fromList [Arg 1 'a', Arg 2 'b']
Arg 2 'b'
>>> V.maximum $ V.fromList [Arg 1 'a', Arg 1 'b']
Arg 1 'a'