-{-# OPTIONS -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -fno-implicit-prelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Word
#include "MachDeps.h"
+-- #hide
module GHC.Word (
Word(..), Word8(..), Word16(..), Word32(..), Word64(..),
toEnumError, fromEnumError, succError, predError)
instance Bounded Word where
minBound = 0
+
+ -- use unboxed literals for maxBound, because GHC doesn't optimise
+ -- (fromInteger 0xffffffff :: Word).
#if WORD_SIZE_IN_BITS == 31
- maxBound = 0x7FFFFFFF
+ maxBound = W# (int2Word# 0x7FFFFFFF#)
#elif WORD_SIZE_IN_BITS == 32
- maxBound = 0xFFFFFFFF
+ maxBound = W# (int2Word# 0xFFFFFFFF#)
#else
- maxBound = 0xFFFFFFFFFFFFFFFF
+ maxBound = W# (int2Word# 0xFFFFFFFFFFFFFFFF#)
#endif
instance Ix Word where