
27 Feb
2009
27 Feb
'09
11:34 a.m.
Claus Reinke wrote:
Here is a trivial example with drastic difference between T = Int and T = Word (~2.5x here):
main = print $ foldl' (+) 0 [1..100000000::T] ..
A quick grep shows almost no specialization at all for Word, or for IntXX/WordXX (see below). Still, none of that seems to explain the example repeated at the top of this message.
The Enum instance for Int uses specialised implementations of enumFromTo and friends, whereas the Word version uses the generic integralEnumFromTo. Cheers, Simon