Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
sum :: (Foldable t, Num a) => t a -> aincipit-base Incipit.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 :: (Generator c, Num (Elem c)) => c -> Elem creducers Data.Generator.Combinators Efficiently sum over the members of any Generator
reduceWith getSum
sum :: forall (m :: Type -> Type) a . (Monad m, Num a) => Fold m a astreamly-core Streamly.Data.Fold Determine the sum of all elements of a stream of numbers. Returns additive identity (0) when the stream is empty. Note that this is not numerically stable for floating point numbers.
>>> sum = Fold.cumulative Fold.windowSum
Same as following but numerically stable:>>> sum = Fold.foldl' (+) 0 >>> sum = fmap Data.Monoid.getSum $ Fold.foldMap Data.Monoid.Sum
sum :: forall (m :: Type -> Type) a . (Monad m, Num a) => Fold m a astreamly-core Streamly.Internal.Data.Fold Determine the sum of all elements of a stream of numbers. Returns additive identity (0) when the stream is empty. Note that this is not numerically stable for floating point numbers.
>>> sum = Fold.cumulative Fold.windowSum
Same as following but numerically stable:>>> sum = Fold.foldl' (+) 0 >>> sum = fmap Data.Monoid.getSum $ Fold.foldMap Data.Monoid.Sum
-
battleship-combinatorics Combinatorics.Battleship.Count.Counter No documentation available.
sum :: (Foldable t, Num a) => t a -> acalligraphy Calligraphy.Prelude 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 -> aclash-prelude Clash.HaskellPrelude 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 :: (C sh, Floating a) => Vector sh a -> acomfort-blas Numeric.BLAS.Vector forVector number_ $ \xs -> Vector.sum xs == List.sum (Vector.toList xs)
sum :: (C sh, Floating a) => T shA sh a -> acomfort-blas Numeric.BLAS.Vector.Slice forSliced number_ $ \xs -> VectorSlice.sum xs == List.sum (listFromSlice xs)
sum :: (Typed a, Num a, Eq a) => Int -> Stream a -> Stream acopilot-libraries Copilot.Library.Statistics Summation.