|
|
|
|
|
Description |
GHC uses several kinds of name internally:
- OccName.OccName: see OccName
- RdrName.RdrName: see RdrName
- Name: see Name
- Id.Id: see Id
- Var is a synonym for the Id.Id type but it may additionally potentially contain type variables,
which have a Kind rather than a Type and only contain some extra details during typechecking.
These Var names may either be global or local, see Var
Global Ids and Vars are those that are imported or correspond to a data constructor, primitive operation, or record selectors.
Local Ids and Vars are those bound within an expression (e.g. by a lambda) or at the top level of the module being compiled.
|
|
Synopsis |
|
|
|
|
The main data type
|
|
|
Essentially a typed Name, that may also contain some additional information
about the Var and it's use sites.
| Instances | |
|
|
Taking Vars apart
|
|
|
|
|
|
|
|
Modifying Vars
|
|
|
|
|
|
|
|
Constructing, taking apart, modifying Ids
|
|
|
|
|
|
|
Exported Vars will not be removed as dead code
|
|
|
|
|
|
|
|
|
|
|
If it's a local, make it global
|
|
|
Exports the given local Id. Can also be called on global Ids, such as data constructors
and class operations, which are born as global Ids and automatically exported
|
|
|
We can only do this to LocalIds
|
|
Predicates
|
|
|
|
|
|
|
|
|
|
|
isLocalVar returns True for type variables as well as local Ids
These are the variables that we need to pay attention to when finding free
variables, or doing dependency analysis.
|
|
|
|
|
|
|
isExportedIdVar means "don't throw this away"
|
|
|
mustHaveLocalBinding returns True of Ids and TyVars
that must have a binding in this module. The converse
is not quite right: there are some global Ids that must have
bindings, such as record selectors. But that doesn't matter,
because it's only used for assertions
|
|
Type variable data type
|
|
|
|
Constructing TyVars
|
|
|
|
|
|
|
Create a type variable that is never referred to, so its unique doesn't
matter
|
|
Taking TyVars apart
|
|
|
|
|
|
|
|
Modifying TyVars
|
|
|
|
|
|
|
|
Coercion variable data type
|
|
|
|
Constructing CoVars
|
|
|
|
Taking CoVars apart
|
|
|
|
Modifying CoVars
|
|
|
|
|
|
Var type synonyms
|
|
|
|
|
|
Produced by Haddock version 2.6.1 |