-- | The 'sum' function computes the sum of a finite list of numbers.
sum :: (Num a) => [a] -> a
sum = foldl (+) 0
код взят из документации ghc 7.4.1 (debian)
-- | The 'sum' function computes the sum of a finite list of numbers.
sum :: (Num a) => [a] -> a
sum = foldl (+) 0
код взят из документации ghc 7.4.1 (debian)