... | ... | @@ -39,16 +39,14 @@ data NameSort |
|
|
-- OccName is very uninformative (like 's')
|
|
|
```
|
|
|
|
|
|
<table><tr><th>`Internal`, `System`</th>
|
|
|
<td>
|
|
|
* **`Internal`, `System`**
|
|
|
|
|
|
An `Internal``Name` has only an occurrence name. Distinct `Internal``Names` may have the same occurrence name; the `n_uniq` distinguishes them.
|
|
|
</td></tr></table>
|
|
|
|
|
|
>
|
|
|
> There is only a tiny difference between `Internal` and `System`; the former simply remembers that the name was originally written by the programmer, which helps when generating error messages.
|
|
|
There is only a tiny difference between `Internal` and `System`; the former simply remembers that the name was originally written by the programmer, which helps when generating error messages.
|
|
|
|
|
|
* **`External`**
|
|
|
|
|
|
<table><tr><th>`External`</th>
|
|
|
<td>
|
|
|
An `External``Name` has a globally-unique (module, occurrence name) pair, namely the original name of the entity, that describes where the thing was originally defined. So for example, if we have
|
|
|
|
|
|
```wiki
|
... | ... | @@ -63,18 +61,14 @@ module A where |
|
|
```
|
|
|
|
|
|
then in module `A`, the function `Q.f` has an External Name `M.f`.
|
|
|
</td></tr></table>
|
|
|
|
|
|
> >
|
|
|
> > During any invocation of GHC, each (module, occurrence-name) gets one, and only one, `Unique`, stored in the `n_uniq` field of the `Name`. This association remains fixed even when GHC finishes one module and starts to compile another. This association between (module, occurrence-name) pairs and the corresponding `Name` (with its `n_uniq` field) is maintained by the Name Cache.
|
|
|
* During any invocation of GHC, each (module, occurrence-name) gets one, and only one, `Unique`, stored in the `n_uniq` field of the `Name`. This association remains fixed even when GHC finishes one module and starts to compile another. This association between (module, occurrence-name) pairs and the corresponding `Name` (with its `n_uniq` field) is maintained by the Name Cache.
|
|
|
|
|
|
* **`WiredIn`**
|
|
|
|
|
|
<table><tr><th>`WiredIn`</th>
|
|
|
<td>
|
|
|
A `WiredIn``Name` is a special sort of `External``Name`, one that is completely known to the compiler (e.g. the `Bool` type constructor). See [Commentary/Compiler/WiredIn](commentary/compiler/wired-in).
|
|
|
</td></tr></table>
|
|
|
|
|
|
> >
|
|
|
> > The `BuiltInSyntax` field is just a boolean yes/no flag that identifies entities that are denoted by built-in syntax, such as `[]` for the empty list. These `Names` aren't "in scope" as such, and we occasionally need to know that.
|
|
|
* The `BuiltInSyntax` field is just a boolean yes/no flag that identifies entities that are denoted by built-in syntax, such as `[]` for the empty list. These `Names` aren't "in scope" as such, and we occasionally need to know that.
|
|
|
|
|
|
## Entities and `Names`
|
|
|
|
... | ... | |