minimum -is:exact

The least element of a non-empty structure. This function is equivalent to foldr1 min, and its behavior on structures with multiple largest elements depends on the relevant implementation of min. For the default implementation of min (min x y = if x <= y then x else y), structure order is used as a tie-breaker: if there are multiple least elements, the leftmost of them is chosen (this is equivalent to minimumBy compare). 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 minimum in faster than linear time.

Examples

Basic usage:
>>> minimum [1..10]
1
>>> minimum []
*** Exception: Prelude.minimum: empty list
>>> minimum Nothing
*** Exception: minimum: empty structure
WARNING: This function is partial for possibly-empty structures like lists.
The least element of a non-empty structure. This function is equivalent to foldr1 min, and its behavior on structures with multiple largest elements depends on the relevant implementation of min. For the default implementation of min (min x y = if x <= y then x else y), structure order is used as a tie-breaker: if there are multiple least elements, the leftmost of them is chosen (this is equivalent to minimumBy compare).
>>> minimum (32 :| [64, 8, 128, 16])
8
minimum returns the minimum value from a list, which must be non-empty, finite, and of an ordered type. This function is equivalent to foldr1 min, and its behavior on lists with multiple minima depends on the relevant implementation of min. For the default implementation of min, list order is used as a tie-breaker: if there are multiple minima, the leftmost of them is chosen (this is equivalent to minimumBy compare).
>>> minimum []
*** Exception: Prelude.minimum: empty list

>>> minimum [42]
42

>>> minimum [55, -12, 7, 0, -89]
-89

>>> minimum [1..]
* Hangs forever *
O(n) minimum returns the minimum value from a ByteString An exception will be thrown in the case of an empty ByteString.
minimum returns the minimum value from a ByteString
O(n) minimum returns the minimum value from a ByteString
O(n) minimum returns the minimum value from a Text, which must be non-empty.
O(n) minimum returns the minimum value from a Text, which must be non-empty. Properties
minimum . stream = minimum
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'
Get the smallest value in the stream, if present. Subject to fusion
The least 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 minimum in faster than linear time.

Examples

Basic usage:
>>> minimum [1..10]
1
>>> minimum []
*** Exception: Prelude.minimum: empty list
>>> minimum Nothing
*** Exception: minimum: empty structure
WARNING: This function is partial for possibly-empty structures like lists.
Find the minimum element of a Producer
argmin
Computes the minimum element
Computes the minimum byte
Computes the minimum element
Computes the minimum character
minimum stream returns the greatest element in stream minimum consumes the entire stream.
ghci> is <- Streams.fromList [1, 2, 3]
ghci> Streams.minimum is
1
ghci> Streams.read is    -- The stream is now empty
Nothing
O(n) minimum returns the minimum value from a ByteString