The current behavior is quite intentional.
On Mon, Jun 1, 2015 at 1:23 PM, David Feuer david.fe...@gmail.com wrote:
I think this is a mistake, yes. They should not raise such exceptions, but
rather just wrap around—minBound `quot` (-1) should be -minBound=minBound.
That would justify the
and div result in an
arithmetic overflow:
Prelude (minBound :: Int) `quot` (-1)
*** Exception: arithmetic overflow
Prelude (minBound :: Int) `div` (-1)
*** Exception: arithmetic overflow
while rem and mod don't:
Prelude (minBound :: Int) `rem` (-1)
0
Prelude (minBound :: Int) `mod` (-1)
0
-Real.html
Note, however, that there is a case when quot and div result in an
arithmetic overflow:
Prelude (minBound :: Int) `quot` (-1)
*** Exception: arithmetic overflow
Prelude (minBound :: Int) `div` (-1)
*** Exception: arithmetic overflow
while rem and mod don't:
Prelude (minBound :: Int