Commit 436695f2 authored by Ziyang Liu's avatar Ziyang Liu

Update module names and links in wired in

parent ad4b4195
......@@ -13,13 +13,13 @@ There are three categories of entities that GHC "knows about"; that is, informat
A **Wired-in thing** is fully known to GHC. Most of these are `TyCon`s such as `Bool`. It is very convenient to simply be able to refer to `boolTyCon :: TyCon` without having to look it up in an environment.
All [primitive types](commentary/compiler/type-type#classifying-types) are wired-in things, and have wired-in `Name`s. The primitive types (and their `Names`) are all defined in [compiler/prelude/TysPrim.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/prelude/TysPrim.hs).
All [primitive types](commentary/compiler/type-type#classifying-types) are wired-in things, and have wired-in `Name`s. The primitive types (and their `Names`) are all defined in [compiler/GHC/Builtin/Types/Prim.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/GHC/Builtin/Types/Prim.hs).
The non-primitive wired-in type constructors are defined in [compiler/prelude/TysWiredIn.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/prelude/TysWiredIn.hs). There are a handful of wired-in `Id`s in [compiler/basicTypes/MkId.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/basicTypes/MkId.hs). There are no wired-in classes (they are too complicated).
The non-primitive wired-in type constructors are defined in [compiler/GHC/Builtin/Types.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/GHC/Builtin/Types.hs). There are a handful of wired-in `Id`s in [compiler/GHC/Types/Id/Make.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/GHC/Types/Id/Make.hs). There are no wired-in classes (they are too complicated).
All the non-primitive wired-in things are *also* defined in GHC's libraries, because even though GHC knows about them we still need to generate code for them. For example, `Bool` is a wired-in type constructor, but it is still defined in `GHC.Base` because we need the info table etc for the data constructors. Arbitrarily bad things will happen if the wired-in definition in [compiler/prelude/TysWiredIn.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/prelude/TysWiredIn.hs) differs from that in the library module.
All the non-primitive wired-in things are *also* defined in GHC's libraries, because even though GHC knows about them we still need to generate code for them. For example, `Bool` is a wired-in type constructor, but it is still defined in `GHC.Base` because we need the info table etc for the data constructors. Arbitrarily bad things will happen if the wired-in definition in [compiler/GHC/Builtin/Types.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/GHC/Builtin/Types.hs) differs from that in the library module.
......@@ -36,7 +36,7 @@ A **known-key thing** has a fixed, pre-allocated `Unique` or **key**. They shou
- Its `Unique`
Almost all known-key names are defined in [compiler/prelude/PrelNames.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/prelude/PrelNames.hs); for example: `PrelNames.eqClassName :: Name`.
Almost all known-key names are defined in [compiler/GHC/Builtin/Names.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/GHC/Builtin/Names.hs); for example: `GHC.Builtin.Names.eqClassName :: Name`.
The point about known-key things is that GHC knows its *name*, but not its *definition*. The definition must still be read from an interface file as usual. The known key just allows an efficient lookup in the environment.
......@@ -72,5 +72,5 @@ An **Orig RdrName thing** has a top-level definition of a `RdrName`, using the `
- Its `OccName`
Again, almost all of these are in [compiler/prelude/PrelNames.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/prelude/PrelNames.hs).
Example: `PrelNames.not_RDR :: RdrName`.
Again, almost all of these are in [compiler/GHC/Builtin/Names.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/GHC/Builtin/Names.hs).
Example: `GHC.Builtin.Names.not_RDR :: RdrName`.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment