Hoogle Search
Within LTS Haskell 24.3 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
sum :: (Index ix, Source r e, Num e) => Array r ix e -> emassiv Data.Massiv.Array O(n) - Compute sum of all elements.
sum :: (Foldable f, Num a) => f a -> aprotolude Protolude.List No documentation available.
sum :: (Foldable t, Num a) => t a -> aprotolude Protolude.Partial The sum function computes the sum of the numbers of a structure.
Examples
Basic usage:>>> sum [] 0
>>> sum [42] 42
>>> sum [1..10] 55
>>> sum [4.1, 2.0, 1.7] 7.8
>>> sum [1..] * Hangs forever *
sum :: (Foldable t, Semiring a) => t a -> asemirings Data.Semiring The sum function computes the additive sum of the elements in a structure. This function is lazy. For a strict version, see sum'.
sum :: (Foldable t, Num a) => t a -> aghc-internal GHC.Internal.Data.Foldable The sum function computes the sum of the numbers of a structure.
Examples
Basic usage:>>> sum [] 0
>>> sum [42] 42
>>> sum [1..10] 55
>>> sum [4.1, 2.0, 1.7] 7.8
>>> sum [1..] * Hangs forever *
sum :: (Foldable t, Num a) => t a -> aghc-internal GHC.Internal.Data.List The sum function computes the sum of the numbers of a structure.
Examples
Basic usage:>>> sum [] 0
>>> sum [42] 42
>>> sum [1..10] 55
>>> sum [4.1, 2.0, 1.7] 7.8
>>> sum [1..] * Hangs forever *
-
ghc-internal GHC.Internal.Data.OldList The sum function computes the sum of a finite list of numbers.
>>> sum [] 0 >>> sum [42] 42 >>> sum [1..10] 55 >>> sum [4.1, 2.0, 1.7] 7.8 >>> sum [1..] * Hangs forever *
-
ghc-internal GHC.Internal.List The sum function computes the sum of a finite list of numbers.
>>> sum [] 0 >>> sum [42] 42 >>> sum [1..10] 55 >>> sum [4.1, 2.0, 1.7] 7.8 >>> sum [1..] * Hangs forever *
-
numeric-prelude Algebra.Additive Sum up all elements of a list. An empty list yields zero. This function is inappropriate for number types like Peano. Maybe we should make sum a method of Additive. This would also make lengthLeft and lengthRight superfluous.
-
numeric-prelude Algebra.NonNegative No documentation available.