[Haskell-cafe] abs minBound < (0 :: Int) && negate minBound == (minBound :: Int)
Rustom Mody
rustompmody at gmail.com
Wed Aug 21 10:08:48 CEST 2013
On Wed, Aug 21, 2013 at 11:47 AM, Ketil Malde <ketil at malde.org> wrote:
> On a more serious note, I accept that Int (and other limited precision
> numbers) is a fact of life, and sometimes useful for performance
> reasons.
>
> I would have liked, however, to have a compiler option or some other way
> to make my programs throw an exception on overflow - even if this turned
> out to be slower, I could at least use it when testing my programs,
> which would have caught a few bugs.
Yes for software detection, some will want it and some will not; see
the same discussion a few months ago
http://www.haskell.org/pipermail/haskell-cafe/2013-June/107153.html
The 'some other way' is hardware detection. And there is glimmer of
hope that Intel may begin to do due diligence
http://www.emulators.com/docs/LazyOverflowDetect_Final.pdf
More information about the Haskell-Cafe
mailing list