There is a package that implements an Int that throws an exception on overflow:

    http://hackage.haskell.org/package/safeint

Since Int's existence is pretty much all about trading for performance, I wouldn't recommend holding your breath on the above becoming the default.

If you want things to work like Scheme, that's exactly what Integer is (in GHC, anyhow). And Integer is what you get by default(ing) unless you use something else that is specifically defined to use Int, or specify it yourself.



On Sun, Jun 2, 2013 at 5:02 PM, Tommy Thorn <tt1729@yahoo.com> wrote:
On Jun 2, 2013, at 12:52 , Henry Laxen <nadine.and.henry@pobox.com> wrote:

> Yes, that was it.  The dell was a 32 bit system, and the desktop a 64.  I
> changed everything from Int to Integer, and now both agree.  Thanks for the
> pointer.

Isn't that just terrible? I hate the fact that Haskell was defined to neither trap the overflow
or just treat everything as Integer [like Scheme]. A sacrifice of program safety in the name
of efficiency.

I disagree with this choice and posit that a clever implementation can minimize the cost
of the overflow checking in most relevant cases.

I wish this fatal flaw would be reconsidered for the next major revision.

Tommy


_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe