Behavior of fromInteger on out-of-range arguments
Simon Peyton-Jones
simonpj@microsoft.com
Thu, 28 Feb 2002 06:04:14 -0800
| By the way, the report says: "Class Enum defines operations=20
| on sequentially=20
| ordered types." I think the "sequentially" means that=20
| multiple applications=20
| of succ to a value shall not result in the same value. That's=20
| why I think=20
| that succ (maxBound :: Int) should be an error and not=20
| minBound :: Int.=20
| Because i + 1 should be equal to succ i for every Int value=20
| i, (maxBound ::=20
| Int) + 1 should also be an error and so should every=20
| arithmetic operation=20
| that overflows or underflows.
The revised version of the report
http://research.microsoft.com/~simonpj/haskell98-revised
says that succ maxBound is an error for any Bounded type.
So I think this is covered already.
Simon