Move the [] definion from base to ghc-prim
[ghc-hetmet.git] / compiler / prelude / PrelNames.lhs
index 57de3b0..0613724 100644 (file)
@@ -6,33 +6,33 @@
 
 Nota Bene: all Names defined in here should come from the base package
 
-* ModuleNames for prelude modules, 
+ - ModuleNames for prelude modules, 
        e.g.    pREL_BASE_Name :: ModuleName
 
-* Modules for prelude modules
+ - Modules for prelude modules
        e.g.    pREL_Base :: Module
 
-* Uniques for Ids, DataCons, TyCons and Classes that the compiler 
-  "knows about" in some way
+ - Uniques for Ids, DataCons, TyCons and Classes that the compiler 
+   "knows about" in some way
        e.g.    intTyConKey :: Unique
                minusClassOpKey :: Unique
 
-* Names for Ids, DataCons, TyCons and Classes that the compiler 
-  "knows about" in some way
+ - Names for Ids, DataCons, TyCons and Classes that the compiler 
+   "knows about" in some way
        e.g.    intTyConName :: Name
                minusName    :: Name
-  One of these Names contains
+   One of these Names contains
        (a) the module and occurrence name of the thing
        (b) its Unique
-  The may way the compiler "knows about" one of these things is
-  where the type checker or desugarer needs to look it up. For
-  example, when desugaring list comprehensions the desugarer
-  needs to conjure up 'foldr'.  It does this by looking up
-  foldrName in the environment.
+   The may way the compiler "knows about" one of these things is
+   where the type checker or desugarer needs to look it up. For
+   example, when desugaring list comprehensions the desugarer
+   needs to conjure up 'foldr'.  It does this by looking up
+   foldrName in the environment.
 
-* RdrNames for Ids, DataCons etc that the compiler may emit into
-  generated code (e.g. for deriving).  It's not necessary to know
-  the uniques for these guys, only their names
+ - RdrNames for Ids, DataCons etc that the compiler may emit into
+   generated code (e.g. for deriving).  It's not necessary to know
+   the uniques for these guys, only their names
 
 
 \begin{code}
@@ -231,14 +231,15 @@ genericTyConNames = [crossTyConName, plusTyConName, genUnitTyConName]
 pRELUDE :: Module
 pRELUDE                = mkBaseModule_ pRELUDE_NAME
 
-gHC_PRIM, gHC_BOOL, gHC_UNIT, gHC_ORDERING, gHC_GENERICS, gHC_BASE, gHC_ENUM,
+gHC_PRIM, gHC_TYPES, gHC_BOOL, gHC_UNIT, gHC_ORDERING, gHC_GENERICS, gHC_BASE, gHC_ENUM,
     gHC_SHOW, gHC_READ, gHC_NUM, gHC_INTEGER, gHC_LIST, gHC_PARR,
-    dATA_TUP, dATA_EITHER, dATA_STRING, gHC_PACK, gHC_CONC, gHC_IO_BASE,
+    gHC_TUPLE, dATA_TUPLE, dATA_EITHER, dATA_STRING, gHC_PACK, gHC_CONC, gHC_IO_BASE,
     gHC_ST, gHC_ARR, gHC_STABLE, gHC_ADDR, gHC_PTR, gHC_ERR, gHC_REAL,
     gHC_FLOAT, gHC_TOP_HANDLER, sYSTEM_IO, dYNAMIC, tYPEABLE, gENERICS,
     dOTNET, rEAD_PREC, lEX, gHC_INT, gHC_WORD, mONAD, mONAD_FIX, aRROW,
-    gHC_DESUGAR, rANDOM, gHC_EXTS :: Module
+    gHC_DESUGAR, rANDOM, gHC_EXTS, cONTROL_EXCEPTION :: Module
 gHC_PRIM       = mkPrimModule (fsLit "GHC.Prim")   -- Primitive types and values
+gHC_TYPES   = mkPrimModule (fsLit "GHC.Types")
 gHC_UNIT       = mkPrimModule (fsLit "GHC.Unit")
 gHC_BOOL       = mkPrimModule (fsLit "GHC.Bool")
 gHC_ORDERING   = mkPrimModule (fsLit "GHC.Ordering")
@@ -251,7 +252,8 @@ gHC_NUM             = mkBaseModule (fsLit "GHC.Num")
 gHC_INTEGER    = mkIntegerModule (fsLit "GHC.Integer")
 gHC_LIST       = mkBaseModule (fsLit "GHC.List")
 gHC_PARR       = mkBaseModule (fsLit "GHC.PArr")
-dATA_TUP       = mkBaseModule (fsLit "Data.Tuple")
+gHC_TUPLE      = mkPrimModule (fsLit "GHC.Tuple")
+dATA_TUPLE     = mkBaseModule (fsLit "Data.Tuple")
 dATA_EITHER    = mkBaseModule (fsLit "Data.Either")
 dATA_STRING    = mkBaseModule (fsLit "Data.String")
 gHC_PACK       = mkBaseModule (fsLit "GHC.Pack")
@@ -281,6 +283,7 @@ aRROW               = mkBaseModule (fsLit "Control.Arrow")
 gHC_DESUGAR = mkBaseModule (fsLit "GHC.Desugar")
 rANDOM         = mkBaseModule (fsLit "System.Random")
 gHC_EXTS       = mkBaseModule (fsLit "GHC.Exts")
+cONTROL_EXCEPTION = mkBaseModule (fsLit "Control.Exception")
 
 mAIN, rOOT_MAIN :: Module
 mAIN           = mkMainModule_ mAIN_NAME
@@ -326,7 +329,7 @@ mkMainModule_ m = mkModule mainPackageId m
 \begin{code}
 mkTupleModule :: Boxity -> Arity -> Module
 mkTupleModule Boxed   0 = gHC_UNIT
-mkTupleModule Boxed   _ = dATA_TUP
+mkTupleModule Boxed   _ = gHC_TUPLE
 mkTupleModule Unboxed _ = gHC_PRIM
 \end{code}
 
@@ -608,8 +611,8 @@ breakpointAutoJumpName
 
 -- PrelTup
 fstName, sndName :: Name
-fstName                  = varQual dATA_TUP (fsLit "fst") fstIdKey
-sndName                  = varQual dATA_TUP (fsLit "snd") sndIdKey
+fstName                  = varQual dATA_TUPLE (fsLit "fst") fstIdKey
+sndName                  = varQual dATA_TUPLE (fsLit "snd") sndIdKey
 
 -- Module PrelNum
 numClassName, fromIntegerName, minusName, negateName, plusIntegerName,
@@ -669,7 +672,7 @@ dataClassName = clsQual gENERICS (fsLit "Data") dataClassKey
 
 -- Error module
 assertErrorName    :: Name
-assertErrorName          = varQual gHC_ERR (fsLit "assertError") assertErrorIdKey
+assertErrorName          = varQual gHC_IO_BASE (fsLit "assertError") assertErrorIdKey
 
 -- Enum module (Enum, Bounded)
 enumClassName, enumFromName, enumFromToName, enumFromThenName,