projects
/
ghc-base.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2005-01-28 14:55:05 by simonmar]
[ghc-base.git]
/
GHC
/
Word.hs
diff --git
a/GHC/Word.hs
b/GHC/Word.hs
index
2332c13
..
eb0a9c3
100644
(file)
--- a/
GHC/Word.hs
+++ b/
GHC/Word.hs
@@
-1,4
+1,4
@@
-{-# OPTIONS -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -fno-implicit-prelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Word
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Word
@@
-69,9
+69,6
@@
predError inst_ty =
-- |A 'Word' is an unsigned integral type, with the same size as 'Int'.
data Word = W# Word# deriving (Eq, Ord)
-- |A 'Word' is an unsigned integral type, with the same size as 'Int'.
data Word = W# Word# deriving (Eq, Ord)
-instance CCallable Word
-instance CReturnable Word
-
instance Show Word where
showsPrec p x = showsPrec p (toInteger x)
instance Show Word where
showsPrec p x = showsPrec p (toInteger x)
@@
-135,12
+132,15
@@
instance Integral Word where
instance Bounded Word where
minBound = 0
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
#if WORD_SIZE_IN_BITS == 31
- maxBound = 0x7FFFFFFF
+ maxBound = W# (int2Word# 0x7FFFFFFF#)
#elif WORD_SIZE_IN_BITS == 32
#elif WORD_SIZE_IN_BITS == 32
- maxBound = 0xFFFFFFFF
+ maxBound = W# (int2Word# 0xFFFFFFFF#)
#else
#else
- maxBound = 0xFFFFFFFFFFFFFFFF
+ maxBound = W# (int2Word# 0xFFFFFFFFFFFFFFFF#)
#endif
instance Ix Word where
#endif
instance Ix Word where
@@
-185,9
+185,6
@@
instance Bits Word where
data Word8 = W8# Word# deriving (Eq, Ord)
-- ^ 8-bit unsigned integer type
data Word8 = W8# Word# deriving (Eq, Ord)
-- ^ 8-bit unsigned integer type
-instance CCallable Word8
-instance CReturnable Word8
-
instance Show Word8 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
instance Show Word8 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
@@
-288,9
+285,6
@@
instance Bits Word8 where
data Word16 = W16# Word# deriving (Eq, Ord)
-- ^ 16-bit unsigned integer type
data Word16 = W16# Word# deriving (Eq, Ord)
-- ^ 16-bit unsigned integer type
-instance CCallable Word16
-instance CReturnable Word16
-
instance Show Word16 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
instance Show Word16 where
showsPrec p x = showsPrec p (fromIntegral x :: Int)
@@
-611,9
+605,6
@@
instance Bits Word32 where
#endif
#endif
-instance CCallable Word32
-instance CReturnable Word32
-
instance Show Word32 where
#if WORD_SIZE_IN_BITS < 33
showsPrec p x = showsPrec p (toInteger x)
instance Show Word32 where
#if WORD_SIZE_IN_BITS < 33
showsPrec p x = showsPrec p (toInteger x)
@@
-868,9
+859,6
@@
instance Bits Word64 where
#endif
#endif
-instance CCallable Word64
-instance CReturnable Word64
-
instance Show Word64 where
showsPrec p x = showsPrec p (toInteger x)
instance Show Word64 where
showsPrec p x = showsPrec p (toInteger x)