2 Nov
2005
2 Nov
'05
11:18 a.m.
On 02 November 2005 00:20, Lennart Augustsson wrote:
Furthermore, ghc has a WRONG definition of sum.
Surely not... sum is defined by Haskell 98 as: sum = foldl (+) 0 and this is exactly what GHC provides. Furthermore we have specialised strict versions for Int and Integer. Also, we shouldn't be turning overloaded functions into class methods purely for the purposes of providing optimised versions; that's what the SPECIALISE pragma is for. Cheers, Simon