summaryrefslogtreecommitdiff
path: root/compiler/prelude
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-12-13 10:49:31 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2017-12-13 10:52:10 +0000
commit321b420f4582d103ca7b304867b916a749712e9f (patch)
tree2e76c23cca162b2d00da9b52c73f42bc559a0089 /compiler/prelude
parente40db7b1676627f5291b463405338e7b69fa3f69 (diff)
downloadhaskell-321b420f4582d103ca7b304867b916a749712e9f.tar.gz
Tidy up of wired-in names
Two things here: * While debugging Trac #14561 I found it hard to understand ghcPrimIds and magicIds in MkId. This patch adds more structure and comments. * I also discovered that ($) no longer needs to be a wiredInId because we now have levity polymorphism. So I took dollarId out of MkId; and gave it a levity-polymorphic type in GHC.Base
Diffstat (limited to 'compiler/prelude')
-rw-r--r--compiler/prelude/PrelNames.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs
index 47b146559f..fe70b3d2e0 100644
--- a/compiler/prelude/PrelNames.hs
+++ b/compiler/prelude/PrelNames.hs
@@ -83,7 +83,6 @@ This is accomplished through a combination of mechanisms:
Note [Infinite families of known-key names]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
Infinite families of known-key things (e.g. tuples and sums) pose a tricky
problem: we can't add them to the knownKeyNames finite map which we use to
ensure that, e.g., a reference to (,) gets assigned the right unique (if this
@@ -185,7 +184,7 @@ names with uniques. These ones are the *non* wired-in ones. The
wired in ones are defined in TysWiredIn etc.
-}
-basicKnownKeyNames :: [Name]
+basicKnownKeyNames :: [Name] -- See Note [Known-key names]
basicKnownKeyNames
= genericTyConNames
++ [ -- Classes. *Must* include:
@@ -335,6 +334,7 @@ basicKnownKeyNames
breakpointAutoName, opaqueTyConName,
assertErrorName, traceName,
printName, fstName, sndName,
+ dollarName,
-- Integer
integerTyConName, mkIntegerName,
@@ -1060,8 +1060,8 @@ groupWithName = varQual gHC_EXTS (fsLit "groupWith") groupWithIdKey
fromStringName, otherwiseIdName, foldrName, buildName, augmentName,
mapName, appendName, assertName,
breakpointName, breakpointCondName, breakpointAutoName,
- opaqueTyConName :: Name
-fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
+ opaqueTyConName, dollarName :: Name
+dollarName = varQual gHC_BASE (fsLit "$") dollarIdKey
otherwiseIdName = varQual gHC_BASE (fsLit "otherwise") otherwiseIdKey
foldrName = varQual gHC_BASE (fsLit "foldr") foldrIdKey
buildName = varQual gHC_BASE (fsLit "build") buildIdKey
@@ -1073,6 +1073,7 @@ 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
+fromStringName = varQual dATA_STRING (fsLit "fromString") fromStringClassOpKey
breakpointJumpName :: Name
breakpointJumpName