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}
pRELUDE :: Module
pRELUDE = mkBaseModule_ pRELUDE_NAME
-gHC_PRIM, gHC_BOOL, 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_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_PRIM, gHC_TYPES, gHC_BOOL, gHC_UNIT, gHC_ORDERING, gHC_GENERICS, gHC_CLASSES, gHC_BASE, gHC_ENUM,
+ gHC_SHOW, gHC_READ, gHC_NUM, gHC_INTEGER, gHC_LIST, gHC_PARR,
+ 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, 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")
gHC_GENERICS = mkPrimModule (fsLit "GHC.Generics")
+gHC_CLASSES = mkBaseModule (fsLit "GHC.Classes")
gHC_BASE = mkBaseModule (fsLit "GHC.Base")
gHC_ENUM = mkBaseModule (fsLit "GHC.Enum")
gHC_SHOW = mkBaseModule (fsLit "GHC.Show")
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")
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
\begin{code}
mkTupleModule :: Boxity -> Arity -> Module
-mkTupleModule Boxed 0 = gHC_BASE
-mkTupleModule Boxed _ = dATA_TUP
+mkTupleModule Boxed 0 = gHC_UNIT
+mkTupleModule Boxed _ = gHC_TUPLE
mkTupleModule Unboxed _ = gHC_PRIM
\end{code}
ltTag_RDR, eqTag_RDR, gtTag_RDR :: RdrName
eq_RDR = nameRdrName eqName
ge_RDR = nameRdrName geName
-ne_RDR = varQual_RDR gHC_BASE (fsLit "/=")
-le_RDR = varQual_RDR gHC_BASE (fsLit "<=")
-lt_RDR = varQual_RDR gHC_BASE (fsLit "<")
-gt_RDR = varQual_RDR gHC_BASE (fsLit ">")
-compare_RDR = varQual_RDR gHC_BASE (fsLit "compare")
+ne_RDR = varQual_RDR gHC_CLASSES (fsLit "/=")
+le_RDR = varQual_RDR gHC_CLASSES (fsLit "<=")
+lt_RDR = varQual_RDR gHC_CLASSES (fsLit "<")
+gt_RDR = varQual_RDR gHC_CLASSES (fsLit ">")
+compare_RDR = varQual_RDR gHC_CLASSES (fsLit "compare")
ltTag_RDR = dataQual_RDR gHC_ORDERING (fsLit "LT")
eqTag_RDR = dataQual_RDR gHC_ORDERING (fsLit "EQ")
gtTag_RDR = dataQual_RDR gHC_ORDERING (fsLit "GT")
not_RDR, getTag_RDR, succ_RDR, pred_RDR, minBound_RDR, maxBound_RDR,
range_RDR, inRange_RDR, index_RDR,
unsafeIndex_RDR, unsafeRangeSize_RDR :: RdrName
-not_RDR = varQual_RDR gHC_BASE (fsLit "not")
+not_RDR = varQual_RDR gHC_CLASSES (fsLit "not")
getTag_RDR = varQual_RDR gHC_BASE (fsLit "getTag")
succ_RDR = varQual_RDR gHC_ENUM (fsLit "succ")
pred_RDR = varQual_RDR gHC_ENUM (fsLit "pred")
-- Base classes (Eq, Ord, Functor)
eqClassName, eqName, ordClassName, geName, functorClassName :: Name
-eqClassName = clsQual gHC_BASE (fsLit "Eq") eqClassKey
-eqName = methName gHC_BASE (fsLit "==") eqClassOpKey
-ordClassName = clsQual gHC_BASE (fsLit "Ord") ordClassKey
-geName = methName gHC_BASE (fsLit ">=") geClassOpKey
+eqClassName = clsQual gHC_CLASSES (fsLit "Eq") eqClassKey
+eqName = methName gHC_CLASSES (fsLit "==") eqClassOpKey
+ordClassName = clsQual gHC_CLASSES (fsLit "Ord") ordClassKey
+geName = methName gHC_CLASSES (fsLit ">=") geClassOpKey
functorClassName = clsQual gHC_BASE (fsLit "Functor") functorClassKey
-- Class Monad
augmentName = varQual gHC_BASE (fsLit "augment") augmentIdKey
mapName = varQual gHC_BASE (fsLit "map") mapIdKey
appendName = varQual gHC_BASE (fsLit "++") appendIdKey
-andName = varQual gHC_BASE (fsLit "&&") andIdKey
-orName = varQual gHC_BASE (fsLit "||") orIdKey
+andName = varQual gHC_CLASSES (fsLit "&&") andIdKey
+orName = varQual gHC_CLASSES (fsLit "||") orIdKey
assertName = varQual gHC_BASE (fsLit "assert") assertIdKey
breakpointName = varQual gHC_BASE (fsLit "breakpoint") breakpointIdKey
breakpointCondName= varQual gHC_BASE (fsLit "breakpointCond") breakpointCondIdKey
breakpointAutoName= varQual gHC_BASE (fsLit "breakpointAuto") breakpointAutoIdKey
opaqueTyConName = tcQual gHC_BASE (fsLit "Opaque") opaqueTyConKey
-+breakpointJumpName :: Name
+breakpointJumpName :: Name
breakpointJumpName
= mkInternalName
breakpointJumpIdKey
-- 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,
-- 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,