|
|
|
|
|
Description |
This module defines the notion of a scope and operations on scopes.
|
|
Synopsis |
|
|
|
|
Scope representation
|
|
|
A scope is a named collection of names partitioned into public and private
names.
| Constructors | | Instances | |
|
|
|
Constructors | PrivateNS | | PublicNS | | ImportedNS | |
| Instances | |
|
|
|
|
|
|
|
|
|
The complete information about the scope at a particular program point
includes the scope stack, the local variables, and the context precedence.
| Constructors | | Instances | |
|
|
|
Local variables
|
|
|
A NameSpace contains the mappings from concrete names that the user can
write to the abstract fully qualified names that the type checker wants to
read.
| Constructors | | Instances | |
|
|
|
|
|
|
|
|
|
|
|
|
| Methods | | | Instances | |
|
|
|
|
|
We distinguish constructor names from other names.
| Constructors | | Instances | |
|
|
|
Apart from the name, we also record whether it's a constructor or not and
what the fixity is.
| Constructors | | Instances | |
|
|
|
For modules we record the arity. I'm not sure that it's every used anywhere.
| Constructors | | Instances | |
|
|
|
|
Operations on names
|
|
Operations on name and module maps.
|
|
|
|
Operations on name spaces
|
|
|
The empty name space.
|
|
|
Map functions over the names and modules in a name space.
|
|
|
Zip together two name spaces.
|
|
|
Map monadic function over a namespace.
|
|
General operations on scopes
|
|
|
The empty scope.
|
|
|
The empty scope info.
|
|
|
Map functions over the names and modules in a scope.
|
|
|
Same as mapScope but applies the same function to all name spaces.
|
|
|
Map monadic functions over the names and modules in a scope.
|
|
|
Same as mapScopeM but applies the same function to both the public and
private name spaces.
|
|
|
Zip together two scopes. The resulting scope has the same name as the
first scope.
|
|
|
Same as zipScope but applies the same function to both the public and
private name spaces.
|
|
|
Filter a scope keeping only concrete names matching the predicates.
The first predicate is applied to the names and the second to the modules.
|
|
|
Return all names in a scope.
|
|
|
|
|
|
|
|
|
Merge two scopes. The result has the name of the first scope.
|
|
|
Merge a non-empty list of scopes. The result has the name of the first
scope in the list.
|
|
Specific operations on scopes
|
|
|
Move all names in a scope to the given name space (except never move from
Imported to Public).
|
|
|
Add names to a scope.
|
|
|
Add a name to a scope.
|
|
|
Add a module to a scope.
|
|
|
Apply an ImportDirective to a scope.
|
|
|
Rename the abstract names in a scope.
|
|
|
Restrict the private name space of a scope
|
|
|
Get the public parts of the public modules of a scope
|
|
|
|
|
Look up a name in the scope
|
|
Inverse look-up
|
|
|
Find the shortest concrete name that maps (uniquely) to a given abstract
name.
|
|
|
Takes the first component of inverseScopeLookup.
|
|
|
Takes the second component of inverseScopeLookup.
|
|
Produced by Haddock version 2.4.2 |