[Jay Cox <sqrtofone@yahoo.com>]
(+):: Num a => a -> a -> a therefore sum :: Num a => [a] -> a -> a now, for any conceivable sum, you generally need both arguments to compute it (or am I wrong?), so i guess you could say (+) should probably be strict for both arguments. But how would you tell the compiler that?
oh wait. . o O 0 church numerals... peano numerals....
data Peano = Zero | Succ (Peano)
sumpeano blah (Succ x) = sumpeano (Succ blah) x sumpeano blah Zero = blah
sumpeano not strict on first argument. define instance Num for Peano.
I dont even know if you could talk about strictness in either argument with church numerals. (and I'm to lazy to remind myself what a church numeral looks like precisely so that I could find out.)
i suppose this is getting a bit off-topic, but for any instance of Num with an additive identity, (+) probably doesn't need to be strict for both arguments, right? consider: sum 0 x = x sum x y = x + y if the first argument is 0, we don't need to inspect the second argument at all. if i'm correct, this just reinforces your point... m -- matt hellige matt@immute.net http://matt.immute.net