
15 Dec
2015
15 Dec
'15
6:06 p.m.
On Tue, Dec 15, 2015 at 1:15 AM, Thomas Koster
Phil, I think that was true in 7.8, but if I'm reading the haddocks correctly, Data.List.sum = Data.Foldable.sum in 7.10, and Data.Foldable.sum uses foldMap/foldr.
On 15 December 2015 at 19:11, Phil Ruffwind
According to the source code for base-4.8 (GHC 7.10), sum is specialized to GHC.List.sum for lists.
https://hackage.haskell.org/package/base-4.8.1.0/docs/src/Data.Foldable.html...
My mistake. I didn't read past this: class Foldable t where foldMap f = foldr (mappend . f) mempty sum = getSum #. foldMap Sum instance Foldable [] where foldr = List.foldr -- Thomas Koster