| John Peterson writes
| 
|   Int is really not a nice
|   datatype and we shouldn't be allowing it to crop up unexpectedly.
| 
| Yes, but if we believed that, we should use Integer, not Int, for
| length.
| 
| 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

I'd like to support John P. and Colin R. on this point. The very
Haskell beginner enters the Hugs interpreter and types (motivated by
his instructor)

Prelude> product [1..100]
0

Ops, the instructor forgot that the default default is Int. Beginners
who already worry about performance (by a constant factor) should have
no problem in adding a default declaration.

Having Integer as the default default has also the beneficial side-effect
to motivate implementors to improve upon the status quo ;-).

Cheers, Ralf


Reply via email to