[Haskell-cafe] Integers v ints

Jesper Louis Andersen jesper.louis.andersen at gmail.com
Fri Apr 2 09:56:05 EDT 2010


On Thu, Apr 1, 2010 at 11:27 AM, Jens Blanck <jens.blanck at gmail.com> wrote:
> I was wondering if someone could give me some references to when and why the
> choice was made to default integral numerical literals to Integer rather
> than to Int in Haskell. Also, if you are aware of similar discussions in
> other languages.

There is one for Erlang I am aware of. Unfortunately I can't remember
where I have read it, so it will have to come off of my head rather
than by correct citation. I think it was Joe Armstrong who mused over
the idea of having integers of arbitrary size. The argument is that a
bug in software due to overflow can be very costly to fix in big
installations. As such, it is better to avoid problems by using,
essentially, Integer as the default integer type.


More information about the Haskell-Cafe mailing list