[Git][ghc/ghc][wip/spj-reinstallable-base] Wibbles
Simon Peyton Jones pushed to branch wip/spj-reinstallable-base at Glasgow Haskell Compiler / GHC Commits: ac6b06ae by Simon Peyton Jones at 2026-03-17T15:10:04+00:00 Wibbles - - - - - 2 changed files: - compiler/GHC/Builtin/Names.hs - libraries/base/src/GHC/KnownKeyNames.hs Changes: ===================================== compiler/GHC/Builtin/Names.hs ===================================== @@ -39,7 +39,27 @@ the big-num package or (for plugins) the ghc package. Note [Overview of known-key names] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -TODO -- write this Note! +A "known-key" name is one + * whose Unique and OccName are baked into GHC + * but that's all that GHC knows about it +In particular, GHC does /not/ know in which module the entity +is defined. + +Example: the `Eq` class has OccName "Eq" and unique `eqClassKey`. +It happens to be defined in ghc-internal:GHC.Internal.Classes, +but GHC does not know that. + +There are several different reasons that GHC might want to refer +to a known-key Name: + +* When desugaring, the desugarer wants to refer to a particular + class, type, or function. It does this via (e.g.) + dsLookupTyKnownKeyTyCon :: Unique -> DsM TyCon + +* When solving a constraint like (Typeable ty), which has built-in + instances, GHC needs to know whether this is the actual class + Typeable, not + Note [Known-key names] <---- OLD VERSION ~~~~~~~~~~~~~~~~~~~~~~ ===================================== libraries/base/src/GHC/KnownKeyNames.hs ===================================== @@ -1,4 +1,3 @@ -{-# LANGUAGE NoImplicitKnownKeyNames #-} -- | -- -- Module : GHC.KnownKeyNames View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ac6b06ae48c5fc6cb7b8cce1ced0bc93... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ac6b06ae48c5fc6cb7b8cce1ced0bc93... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)