[commit: ghc] wip/typeable-unwired: Move TypeRep declarations (065e7b4)

git at git.haskell.org git at git.haskell.org
Fri Feb 12 12:23:40 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/typeable-unwired
Link       : http://ghc.haskell.org/trac/ghc/changeset/065e7b43106afcd4ab733b19b17dcc10490c3af7/ghc

>---------------------------------------------------------------

commit 065e7b43106afcd4ab733b19b17dcc10490c3af7
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Fri Feb 12 12:40:59 2016 +0100

    Move TypeRep declarations


>---------------------------------------------------------------

065e7b43106afcd4ab733b19b17dcc10490c3af7
 libraries/ghc-prim/GHC/Types.hs | 90 ++++++++++++++++++++---------------------
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/libraries/ghc-prim/GHC/Types.hs b/libraries/ghc-prim/GHC/Types.hs
index a1aea0b..cad321a 100644
--- a/libraries/ghc-prim/GHC/Types.hs
+++ b/libraries/ghc-prim/GHC/Types.hs
@@ -43,6 +43,51 @@ import GHC.Prim
 
 infixr 5 :
 
+{- *********************************************************************
+*                                                                      *
+             Runtime representation of TyCon
+*                                                                      *
+********************************************************************* -}
+
+{- Note [Runtime representation of modules and tycons]
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+We generate a binding for M.$modName and M.$tcT for every module M and
+data type T.  Things to think about
+
+  - We want them to be economical on space; ideally pure data with no thunks.
+
+  - We do this for every module (except this module GHC.Types), so we can't
+    depend on anything else (eg string unpacking code)
+
+That's why we have these terribly low-level repesentations.  The TrName
+type lets us use the TrNameS constructor when allocating static data;
+but we also need TrNameD for the case where we are deserialising a TyCon
+or Module (for example when deserialising a TypeRep), in which case we
+can't conveniently come up with an Addr#.
+-}
+
+#include "MachDeps.h"
+
+data Module = Module
+                TrName   -- Package name
+                TrName   -- Module name
+
+data TrName
+  = TrNameS Addr#  -- Static
+  | TrNameD [Char] -- Dynamic
+
+#if WORD_SIZE_IN_BITS < 64
+data TyCon = TyCon
+                Word64#  Word64#   -- Fingerprint
+                Module             -- Module in which this is defined
+                TrName              -- Type constructor name
+#else
+data TyCon = TyCon
+                Word#    Word#
+                Module
+                TrName
+#endif
+
 -- Take note: All types defined here must have associated type representations
 -- defined in Data.Typeable.Internal.
 -- See Note [Representation of types defined in GHC.Types] below.
@@ -341,48 +386,3 @@ data SPEC = SPEC | SPEC2
 -- is the kind of 'Lifted' and 'Unlifted'. @*@ is a synonym for @TYPE Lifted@
 -- and @#@ is a synonym for @TYPE Unlifted at .
 data Levity = Lifted | Unlifted
-
-{- *********************************************************************
-*                                                                      *
-             Runtime representation of TyCon
-*                                                                      *
-********************************************************************* -}
-
-{- Note [Runtime representation of modules and tycons]
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-We generate a binding for M.$modName and M.$tcT for every module M and
-data type T.  Things to think about
-
-  - We want them to be economical on space; ideally pure data with no thunks.
-
-  - We do this for every module (except this module GHC.Types), so we can't
-    depend on anything else (eg string unpacking code)
-
-That's why we have these terribly low-level repesentations.  The TrName
-type lets us use the TrNameS constructor when allocating static data;
-but we also need TrNameD for the case where we are deserialising a TyCon
-or Module (for example when deserialising a TypeRep), in which case we
-can't conveniently come up with an Addr#.
--}
-
-#include "MachDeps.h"
-
-data Module = Module
-                TrName   -- Package name
-                TrName   -- Module name
-
-data TrName
-  = TrNameS Addr#  -- Static
-  | TrNameD [Char] -- Dynamic
-
-#if WORD_SIZE_IN_BITS < 64
-data TyCon = TyCon
-                Word64#  Word64#   -- Fingerprint
-                Module             -- Module in which this is defined
-                TrName              -- Type constructor name
-#else
-data TyCon = TyCon
-                Word#    Word#
-                Module
-                TrName
-#endif



More information about the ghc-commits mailing list