Philip Wadler wrote:
> You are right, beginners may stub their toe on factorial. On the other
> hand, with the default set to Integer, beginners may stub their toe
> on bad performance. Anyone familiar with, say, C, will be unsurprised
> by the need to switch Int to Integer to get factorial to work, but will
> be very surprised by the need to switch Integer to Int to get decent
> performance. -- P
What beginner to haskell writes programs that depend heavily upon integer
performance? I suspect few. Who here would argue that most of the
performance hits of using functional programming have to do with integer
performance? A beginning haskell programmer driven away by poor
performance probably "stubbed his/her toe" on one, or several, of the many
ways that Haskell makes available to the programmer for writing slow
programs, not integer performance.
Despite this, however, I agree that unless we essentially remove Int from
the prelude, it's better to be consistent (i.e. not have a bunch of common
functions return Int, but have Integer be the default). I agree with
Simon that now is not the time to completely shake up the prelude, so I
guess I'm with keeping the default as Int.
--Jeff