[Haskell-cafe] A few questions on primes generating.

Isaac Dupree isaacdupree at charter.net
Mon Aug 13 11:35:33 EDT 2007


L.Guo wrote:
> Because 10,000,000 is too large for a Int

On my pitiful system,
> maxBound::Int
2147483647
is certainly greater than
10000000
.

> it is always in type of Integer or some higher level data type.

Haskell doesn't do static checking like that. In GHC on my system (where
10,000,000,000 is too large for an Int - note ten zeroes),
> 10000000000::Int
1410065408
(Hugs gives "Program error: arithmetic overflow")


Isaac


More information about the Haskell-Cafe mailing list