This library provides unsigned integers of various sizes. The types supported are as follows: type | number of bits @ Word8 | 8 @ Word16 | 16 @ Word32 | 32 @ Word64 | 64 @ For each type data W -- Unsigned Ints instance Eq W instance Ord W instance Show W instance Read W instance Bounded W instance Num W instance Real W instance Integral W instance Enum W instance Ix W instance Bits W Plus word8ToWord32 :: Word8 -> Word32 word32ToWord8 :: Word32 -> Word8 word16ToWord32 :: Word16 -> Word32 word32ToWord16 :: Word32 -> Word16 word8ToInt :: Word8 -> Int intToWord8 :: Int -> Word8 word16ToInt :: Word16 -> Int intToWord16 :: Int -> Word16 word32ToInt :: Word32 -> Int intToWord32 :: Int -> Word32 Notes: All arithmetic is performed modulo 2^n One non-obvious consequequence of this is that The coercion ToDo: complete the set of coercion functions. Use a -> b/ to coerce between different sizes or to preserve sign when converting between values of the same size. It would be very natural to add a type a type The It would be useful to provide a function (or a family of functions?) which coerced between any two Word types (without going through Integer). Hugs only provides