minimumBy package:vector
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 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 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 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 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.