minimum package:vector
O(n) Yield the minimum 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.minimum $ V.fromList [2, 1]
1
>>> import Data.Semigroup
>>> V.minimum $ V.fromList [Arg 2 'a', Arg 1 'b']
Arg 1 'b'
>>> V.minimum $ V.fromList [Arg 1 'a', Arg 1 'b']
Arg 1 'a'
O(n) Yield the minimum element of the vector. The vector may
not be empty. In case of a tie, the first occurrence wins.
Examples
>>> import qualified Data.Vector.Strict as V
>>> V.minimum $ V.fromList [2, 1]
1
>>> import Data.Semigroup
>>> V.minimum $ V.fromList [Arg 2 'a', Arg 1 'b']
Arg 1 'b'
>>> V.minimum $ V.fromList [Arg 1 'a', Arg 1 'b']
Arg 1 'a'
O(n) Yield the minimum element of the vector. The vector may
not be empty. In case of a tie, the first occurrence wins.
Examples
>>> import qualified Data.Vector.Primitive as VP
>>> VP.minimum $ VP.fromList [2, 1 :: Int]
1
O(n) Yield the minimum element of the vector. The vector may
not be empty. In case of a tie, the first occurrence wins.
Examples
>>> import qualified Data.Vector.Storable as VS
>>> VS.minimum $ VS.fromList [2, 1 :: Int]
1
O(n) Yield the minimum element of the vector. The vector may
not be empty. In case of a tie, the first occurrence wins.
Examples
>>> import qualified Data.Vector.Unboxed as VU
>>> VU.minimum $ VU.fromList [2, 1 :: Int]
1
>>> import Data.Semigroup
>>> VU.minimum $ VU.fromList [Arg 2 'a', Arg (1 :: Int) 'b']
Arg 1 'b'
>>> VU.minimum $ VU.fromList [Arg 1 'a', Arg (1 :: Int) 'b']
Arg 1 'a'
O(n) Yield the minimum 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.minimumBy (comparing fst) $ V.fromList [(2,'a'), (1,'b')]
(1,'b')
>>> V.minimumBy (comparing fst) $ V.fromList [(1,'a'), (1,'b')]
(1,'a')
O(n) Yield the minimum element of the vector by comparing the
results of a key function on each element. In case of a tie, the first
occurrence wins. The vector may not be empty.
Examples
>>> import qualified Data.Vector as V
>>> V.minimumOn fst $ V.fromList [(2,'a'), (1,'b')]
(1,'b')
>>> V.minimumOn fst $ V.fromList [(1,'a'), (1,'b')]
(1,'a')
O(n) Yield the minimum 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.Strict as V
>>> V.minimumBy (comparing fst) $ V.fromList [(2,'a'), (1,'b')]
(1,'b')
>>> V.minimumBy (comparing fst) $ V.fromList [(1,'a'), (1,'b')]
(1,'a')
O(n) Yield the minimum element of the vector by comparing the
results of a key function on each element. In case of a tie, the first
occurrence wins. The vector may not be empty.
Examples
>>> import qualified Data.Vector.Strict as V
>>> V.minimumOn fst $ V.fromList [(2,'a'), (1,'b')]
(1,'b')
>>> V.minimumOn fst $ V.fromList [(1,'a'), (1,'b')]
(1,'a')
O(n) Yield the minimum 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.
O(n) Yield the minimum element of the vector by comparing the
results of a key function on each element. In case of a tie, the first
occurrence wins. The vector may not be empty.
O(n) Yield the minimum 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.
O(n) Yield the minimum element of the vector by comparing the
results of a key function on each element. In case of a tie, the first
occurrence wins. The vector may not be empty.
O(n) Yield the minimum 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.Unboxed as VU
>>> VU.minimumBy (comparing fst) $ VU.fromList [(2,'a'), (1 :: Int,'b')]
(1,'b')
>>> VU.minimumBy (comparing fst) $ VU.fromList [(1,'a'), (1 :: Int,'b')]
(1,'a')
O(n) Yield the minimum element of the vector according to the
given comparison function. The vector may not be empty.
O(n) Yield the minimum element of the vector by comparing the
results of a key function on each element. In case of a tie, the first
occurrence wins. The vector may not be empty.
Examples
>>> import qualified Data.Vector.Unboxed as VU
>>> VU.minimumOn fst $ VU.fromList [(2,'a'), (1 :: Int,'b')]
(1,'b')
>>> VU.minimumOn fst $ VU.fromList [(1,'a'), (1 :: Int,'b')]
(1,'a')