What is the difference between Int and Integer?

“Integer” is an arbitrary precision
type: it will hold any number no
matter how big, up to the limit of
your machine’s memory…. This means you never have
arithmetic overflows. On the other
hand it also means your arithmetic is
relatively slow. Lisp users may
recognise the “bignum” type here.

“Int” is the more common 32 or 64 bit
integer. Implementations vary,
although it is guaranteed to be at
least 30 bits.

Source: The Haskell Wikibook. Also, you may find the Numbers section of A Gentle Introduction to Haskell useful.

Leave a Comment