[Haskell-cafe] Number overflow [was: Strange results when trying to create large Bool arrays.]

Lennart Augustsson lennart at augustsson.net
Wed Jul 11 16:16:12 EDT 2007

Yes, I think we want Integer to be the type that is used unless you ask for
something else.
It adheres to the principle of getting it right before optimizing.

On 7/11/07, Andrew Coppin <andrewcoppin at btinternet.com> wrote:
> Stefan O'Rear wrote:
> > On Wed, Jul 11, 2007 at 08:16:50PM +0100, Andrew Coppin wrote:
> >
> >> Of course, sometimes you purposely write code which you know is going
> to
> >> overflow and wrap round in a specific way. But frequently you *don't*
> want
> >> this behaviour - and I wish there were some pragma or something to make
> >> this be checked. AFAIK, most CPU types give you an efficient way to
> testing
> >> for such conditions...
> >>
> >
> > Indeed.  I beleive that Int should be removed from the Prelude.  People
> > who need the algebraic properties of rings modulo 2^(2^n) can use the
> > sized integral types from Data.Int and Data.Word; people who want speed
> > and can satisfy the proof obligations can use Int and Word from the same
> > modules.  Everyone else can use Integer, which should be made shorter
> than
> > Int for obvious psychological reasons.
> >
> Do we really want to do that?
> I mean, make Haskell in general 2 orders of magnitude slower (and heaven
> knows how many orders of magnitude more RAM hungry) for any program
> using more than a handful of integers?
> Personally, I'd prefer a way to just throw an exception when a numeric
> overflow happens. (Probably only for test purposes - so maybe a compiler
> flag?)
> How about the floating-point types? What do they currently do?
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070711/75f1c248/attachment.htm

More information about the Haskell-Cafe mailing list