[commit: ghc-prim] master: Move the Word type from base to ghc-prim (5291677)
Ian Lynagh
igloo at earth.li
Tue May 22 03:59:04 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/ghc-prim
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/529167773a9a036d7d3262707be4c5a2f6a04bcf
>---------------------------------------------------------------
commit 529167773a9a036d7d3262707be4c5a2f6a04bcf
Author: Ian Lynagh <igloo at earth.li>
Date: Mon May 21 23:20:55 2012 +0100
Move the Word type from base to ghc-prim
>---------------------------------------------------------------
GHC/Classes.hs | 2 ++
GHC/Types.hs | 5 ++++-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/GHC/Classes.hs b/GHC/Classes.hs
index 7be590b..7586af4 100644
--- a/GHC/Classes.hs
+++ b/GHC/Classes.hs
@@ -92,6 +92,7 @@ instance (Eq a) => Eq [a] where
deriving instance Eq Bool
deriving instance Eq Ordering
+deriving instance Eq Word
instance Eq Char where
(C# c1) == (C# c2) = c1 `eqChar#` c2
@@ -191,6 +192,7 @@ instance (Ord a) => Ord [a] where
deriving instance Ord Bool
deriving instance Ord Ordering
+deriving instance Ord Word
-- We don't use deriving for Ord Char, because for Ord the derived
-- instance defines only compare, which takes two primops. Then
diff --git a/GHC/Types.hs b/GHC/Types.hs
index e56cc72..c8868da 100644
--- a/GHC/Types.hs
+++ b/GHC/Types.hs
@@ -16,7 +16,7 @@
-----------------------------------------------------------------------------
module GHC.Types (
- Bool(..), Char(..), Int(..),
+ Bool(..), Char(..), Int(..), Word(..),
Float(..), Double(..),
Ordering(..), IO(..)
) where
@@ -48,6 +48,9 @@ data {-# CTYPE "HsChar" #-} Char = C# Char#
-- 'Prelude.minBound' and 'Prelude.maxBound' from the 'Prelude.Bounded' class.
data {-# CTYPE "HsInt" #-} Int = I# Int#
+-- |A 'Word' is an unsigned integral type, with the same size as 'Int'.
+data {-# CTYPE "HsWord" #-} Word = W# Word#
+
-- | Single-precision floating point numbers.
-- It is desirable that this type be at least equal in range and precision
-- to the IEEE single-precision type.
More information about the Cvs-libraries
mailing list