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 behavior of rem and mod, and makes much more sense than the current behavior for Int as a ring.
On Jun 1, 2015 12:41 PM, "Nikita Karetnikov" <nikita@karetnikov.org> wrote:According to the documentation, rem and mod must satisfy the following
laws:
-- > (x `quot` y)*y + (x `rem` y) == x
rem
-- > (x `div` y)*y + (x `mod` y) == x
mod