[Git][ghc/ghc][wip/spj-reinstallable-base] Wibbles
Simon Peyton Jones pushed to branch wip/spj-reinstallable-base at Glasgow Haskell Compiler / GHC Commits: d0530203 by Simon Peyton Jones at 2026-04-06T20:05:45+01:00 Wibbles - - - - - 6 changed files: - compiler/GHC/Builtin.hs - compiler/GHC/Builtin/Names.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Tc/Deriv/Utils.hs - docs/users_guide/separate_compilation.rst - libraries/base/src/GHC/KnownKeyNames.hs Changes: ===================================== compiler/GHC/Builtin.hs ===================================== @@ -14,9 +14,10 @@ -- -- * given a 'Unique', looking up its corresponding known-key 'Name' -- --- See Note [Known-key names] and Note [Oerview of wired-in things] for information --- about the two types of prelude things in GHC. --- +-- See Note [Overview of known-key entities] +-- and Note [Overview of wired-in things] for information +-- about the types of "known" things in GHC. + module GHC.Builtin ( -- * Main exports wiredInNames, wiredInIds, ghcPrimIds, @@ -386,6 +387,12 @@ Note [Overview of wired-in things] * GHC.Iface.Make prunes out wired-in things before putting them in an interface file. So interface files never contain wired-in things. + +See also + - Note [Drop wired-in things] in GHC.Iface.Tidy + - Note [Loading instances for wired-in things] in GHC.Iface.Load + - Note [Related uniques for wired-in things] in GHC.Builtin.Uniques + - Note [Declarations for wired-in things] in GHC.Tc.TyCl -} -- | This list is used to ensure that when you say "Prelude.map" in your source ===================================== compiler/GHC/Builtin/Names.hs ===================================== @@ -591,7 +591,7 @@ gHC_INTERNAL_BASE, gHC_INTERNAL_ENUM, gHC_INTERNAL_FLOAT, gHC_INTERNAL_TOP_HANDLER, gHC_INTERNAL_SYSTEM_IO, gHC_INTERNAL_DYNAMIC, gHC_INTERNAL_TYPEABLE, gHC_INTERNAL_TYPEABLE_INTERNAL, gHC_INTERNAL_GENERICS, gHC_INTERNAL_READ_PREC, gHC_INTERNAL_LEX, gHC_INTERNAL_INT, gHC_INTERNAL_WORD, gHC_INTERNAL_MONAD, gHC_INTERNAL_MONAD_FIX, gHC_INTERNAL_MONAD_FAIL, - gHC_INTERNAL_ARROW, gHC_INTERNAL_DESUGAR, gHC_INTERNAL_RANDOM, gHC_INTERNAL_EXTS, + gHC_INTERNAL_ARROW, gHC_INTERNAL_DESUGAR, gHC_INTERNAL_RANDOM, gHC_INTERNAL_EXTS, gHC_INTERNAL_CONTROL_EXCEPTION_BASE, gHC_INTERNAL_TYPEERROR, gHC_INTERNAL_TYPELITS, gHC_INTERNAL_TYPELITS_INTERNAL, gHC_INTERNAL_TYPENATS, gHC_INTERNAL_TYPENATS_INTERNAL, gHC_INTERNAL_DATA_COERCE, gHC_INTERNAL_DEBUG_TRACE, gHC_INTERNAL_UNSAFE_COERCE, gHC_INTERNAL_FOREIGN_C_CONSTPTR, ===================================== compiler/GHC/HsToCore/Quote.hs ===================================== @@ -2427,12 +2427,12 @@ rep2X lift_dsm get_wrap n xs = do ; return (MkC $ (foldl' App (wrap (Var rep_id)) xs)) } -krep2M :: KnownOcc -> [CoreExpr] -> MetaM (Core (M a)) +-- krep2M :: KnownOcc -> [CoreExpr] -> MetaM (Core (M a)) krep2 :: KnownOcc -> [CoreExpr] -> MetaM (Core (M a)) krep2_nw :: NotM a => KnownOcc -> [CoreExpr] -> MetaM (Core a) krep2_nwDsM :: NotM a => KnownOcc -> [CoreExpr] -> DsM (Core a) krep2 = krep2X lift (asks quoteWrapper) -krep2M = krep2X lift (asks monadWrapper) +-- krep2M = krep2X lift (asks monadWrapper) krep2_nw n xs = lift (krep2_nwDsM n xs) krep2_nwDsM = krep2X id (return id) ===================================== compiler/GHC/Tc/Deriv/Utils.hs ===================================== @@ -66,7 +66,6 @@ import GHC.Types.SrcLoc import GHC.Types.Var.Set import GHC.Builtin.Names -import GHC.Builtin.RdrNames( compose_RDR ) import GHC.Builtin.Names.TH (liftClassKey) import GHC.Utils.Misc ===================================== docs/users_guide/separate_compilation.rst ===================================== @@ -1656,7 +1656,7 @@ defined in the libraries ``ghc-internal`` or ``base``. These include the classe ``Num``, ``Show``, etc, the types ``Rational``, ``Ratio`` etc, and much more. These entities have so-called "known-key" names. -You can read ``Note [Overview of known-key names]`` in GHC's source code +You can read ``Note [Overview of known-key entities]`` in GHC's source code to understand more. The behaviour of known-key names is controlled by two flags: @@ -1681,4 +1681,10 @@ flags: called "Rational" in this module is *the* known-key ``Rational`` and not some other random type or class that happens to be called "Rational". +.. ghc-flag:: -fexclude-known-key-define=(name) + :shortdesc: Do not treat a definition of (name) as a definition of a known-key entity + :type: dynamic + :category: + + You can use this flag multiple times to excludes several names. ===================================== libraries/base/src/GHC/KnownKeyNames.hs ===================================== @@ -1,8 +1,5 @@ {-# LANGUAGE MagicHash, Trustworthy, RankNTypes #-} -{-# OPTIONS_GHC -fdefines-known-key-names #-} - -- See Note [Known-key names and IsList] - -- | -- -- Module : GHC.KnownKeyNames View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d053020348a091e5ef5da0b81face2f9... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d053020348a091e5ef5da0b81face2f9... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)