product package:vector

O(n) Compute the product of the elements.

Examples

>>> import qualified Data.Vector as V

>>> V.product $ V.fromList [1,2,3,4]
24

>>> V.product (V.empty :: V.Vector Int)
1
O(n) Compute the product of the elements.

Examples

>>> import qualified Data.Vector.Strict as V

>>> V.product $ V.fromList [1,2,3,4]
24

>>> V.product (V.empty :: V.Vector Int)
1
O(n) Compute the product of the elements.

Examples

>>> import qualified Data.Vector.Primitive as VP

>>> VP.product $ VP.fromList [1,2,3,4 :: Int]
24

>>> VP.product (VP.empty :: VP.Vector Int)
1
O(n) Compute the product of the elements.

Examples

>>> import qualified Data.Vector.Storable as VS

>>> VS.product $ VS.fromList [1,2,3,4 :: Int]
24

>>> VS.product (VS.empty :: VS.Vector Int)
1
O(n) Compute the product of the elements.

Examples

>>> import qualified Data.Vector.Unboxed as VU

>>> VU.product $ VU.fromList [1,2,3,4 :: Int]
24

>>> VU.product (VU.empty :: VU.Vector Int)
1