Re: Thoughts, Int vs Integer
Thomas Davie <[email protected]> Sun, 25 Jun 2006 01:09:55 +0100
| Newsgroups | gmane.comp.lang.haskell.hat |
|---|---|
| Message-ID | <[email protected]> |
On 24 Jun 2006, at 21:11, Neil Mitchell wrote: > Hi, > >> > 1) big_number * 2 will never overflow, which will give a different >> > semantics. Personally this sounds like a good idea, and having a >> > hat-overflow tool to detect when an Integer goes above 2^31 would >> > probably be a useful addition. I don't consider this change to >> be all >> > that bad, since its compatible with the Haskell98 report (I think). >> >> The basic problem with this is that the bug may well be that an Int >> is overflowing... You don't want the bug to not manifest it's self in >> the self tracing version. > > If we assume that most Haskell numbers are below 2 billion - both Int > and Integer, then its easy enought to detect all the places where a > number exceeds this in the trace. I suspect that for most programs > this will be never. If it does occur, I suspect it will be very rare, > and all these occurences can be listed, which would directly track > down the bug really quickly (faster than with the current Hat tools). > The theoretical "hat-overflow" tool can be written which does this. I think the question is more whether such a tool would ever be run. The users thought path is likely to be along the lines of "oh... it works now... I can't debug it if it worked" Bob