[Haskell-cafe] how to calculate the sum of list of lists?
olandere at gmail.com
Mon Feb 5 12:00:33 EST 2007
If I understand you correctly, this should do it:
sums :: Num a => [[a]] -> a
sums l = sum [sum p | p <- l]
On 2/5/07, Miranda Kajtazi <mirandakajtazi at gmail.com> wrote:
> How to calculate the sum of list of lists in Haskell?
> Please help me,
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe