The following program explains the problem.
The value of expr is -2147483644, minBound::Int is -2147483648.
Hugs gives (-8388608, 4), ghc gives (8388607,4), ghc's answer violates the
law that `div` and `mod` should satisfy according to the Haskell Report.
main :: IO ()
main = putStrLn (show (expr `divMod` 256))
expr :: Int
expr = topbit + 4 where topbit = 2 ^ 31
The program was run on a SPARC running Solaris (SunOS 5.5.1).
GHC was compiled with gcc 2.7.2.3. Different compiler options (-O,
-fvia-c) have no effect.
Apologies if this one is already known.
Tony
Antony Bowers, Department of Computer Science, University of Bristol, UK.
http://www.cs.bris.ac.uk/~bowers/