Simon proposes not to change the prelude to support Integer,
giving this argument:
The more this topic gets discussed the more I that it's like
other Prelude things: you pull on one thing and the plate of
spaghetti ends up in your lap.
I'm confused. I thought at the ICFP Haskell meeting we agreed
on the following types:
length :: Integral i => [a] -> i
take, drop :: Integeral i => i -> [a] -> [a]
showsPrec :: (Show a, Integral i) => i -> a -> ShowS
and so on. These have the advantage that they work with either Int or
Integer. If Haskell implicitly imposes `default (Integer,Double)'
then the old efficiency level can be recalled by simply adding the
line `default (Int,Float)' to your program. The only problem I recall
was what types to give to member of class Floating, and that looked so
odd that it looked to need changing regardless of what we did with Int
and Integer.
Simon argues that it is not so bad to retain Int over Integer, saying
I don't think Chris's "plain ordinary punters" will notice. They
don't write programs with lists longer than 2^31.
I think this argument is misleading. The key to the above proposal is
that it makes it easy to write programs that use either Int or Integer
uniformly. With Simon's proposal, if you wish to use Integer then you
will need to introduce coercions from Int to Integer. This makes life
hard for any punter who wishes to use Integer as a default, or for any
punter who uses Int as a default and gets overflow (admittedly, the
overflow is likely to be on something other than a list length, but so
what?).
I'm not against adopting a conservative design if there is a problem,
but then Simon ought to explain what the problem is.
Cheers, -- P