Simon Marlow notes:
But fromIntegral *does* do the right thing, doesn't it?
Numeric.showHex (fromIntegral (-1 :: Int32) :: Word32)
0x
Interesting. The fact that this fooled Julian as well as me suggests
the behavior needs to be better documented. Interestingly,
PROTECTED]
Subject: RE: Straightforward conversion from Int - Word
I've found this annoying in the past, and have resorted to hitting
it on the head (GHC-specifically) with a blunt instrument:
intToNat :: Int - Word
intToNat (I# i#) = W# (unsafeCast# i#)
This probably defeats
Simon Marlow notes:
But fromIntegral *does* do the right thing, doesn't it?
Numeric.showHex (fromIntegral (-1 :: Int32) :: Word32)
0x
Interesting. The fact that this fooled Julian as well as me suggests
the behavior needs to be better documented. Interestingly, hugs yields