Fiddling around with bits I discovered that `shiftR' (defined in Bits)
has not the expected behaviour.
On 32 bit ints we have
> [ shiftR 2147483647 i :: Int32 | i <- [0..31] ]
[2147483647,0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215,33554431,67108863,134217727,268435455,536870911,1073741823]
Thus shiftR 2147483647 1 yields 0.
On 16 bit ints we have
> [ shiftR 32767 i :: Int16 | i <- [0..15] ]
[32767,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
What kind of irritates me is that hugs and ghc both deliver the same
results.
Cheers, Ralf