[Haskell-cafe] Simple newbie question - Int and Integer

Andrew Coppin andrewcoppin at btinternet.com
Thu Jul 12 14:57:42 EDT 2007

Stefan O'Rear wrote:
> On Thu, Jul 12, 2007 at 07:39:09PM +0100, Andrew Coppin wrote:
>> Int = 32-bit integer.
> Int = 30 bits with undefined overflow behavior
> That "undefined" gives implementations the freedom to use bigger
> representations if convenient.

Personally, my rule of thumb is this:

Int = some number
Integer = some *big* number
Int32 (or whatever) = I actually want it exactly THIS size.

So I just use Int when I don't really care what size the integer is - 
mainly becuase *everything* seems to use Int and it saves on explicit 
type conversions all over the place. (I'm not actually too sure that Int 
*should* be used all over the place - but it'll never be changed, so...)

More information about the Haskell-Cafe mailing list