Names used by the evaluator. This is heavily inspired by GHC.
- data OccName = OccName String
- data UnRenamedName = UnQual OccName
- data Name = Name {
- nameType :: NameType
- nameOccurrence :: !OccName
- nameDefinition :: !SrcSpan
- nameUnique :: !Int
- nameIsConstructor :: Bool
- data NameType
- mkExternalName :: MonadIO m => OccName -> SrcSpan -> Bool -> m Name
- mkInternalName :: MonadIO m => OccName -> SrcSpan -> m Name
- mkWiredInName :: MonadIO m => OccName -> Bool -> m Name
- mkFreshInternalName :: MonadIO m => m Name
- isNameDataConstructor :: Name -> Bool
Data Types
A name that occurs in the source code somewhere.
data UnRenamedName Source
A name that has not yet been renamed. Created by the parser.
Eq UnRenamedName | |
Ord UnRenamedName | |
Show UnRenamedName | |
Typeable UnRenamedName | |
PrettyPrintable UnRenamedName | |
FreeVars (Pat UnRenamedName) | |
FreeVars (Decl UnRenamedName) | |
FreeVars (Stmt UnRenamedName) | |
FreeVars (Field UnRenamedName) | |
Renamable (Match UnRenamedName) (Match Name) | |
Renamable (ModelOption UnRenamedName) (ModelOption Name) | |
Renamable (Assertion UnRenamedName) (Assertion Name) | |
Renamable (InteractiveStmt UnRenamedName) (InteractiveStmt Name) | |
Renamable (Exp UnRenamedName) (Exp Name) | |
Renamable (Module UnRenamedName) (Module Name) |
A renamed name and is the exclusive type used after the renamer. Names are guaranteed to be unique, meaning that two names are equal iff they refer to the same binding instance. For example, consider the following CSPM code:
f = 1 g = let f = 2 within (f, f)
This will be renamed to:
f0 = 1 g = let f1 = 2 within (f1, f1)
Name | |
|
ExternalName | An externally visible name (like a top level definition). |
InternalName | A name created by the renamer, but from the users' source (e.g. from a lambda). |
WiredInName | A built in name. |
Construction Helpers
mkFreshInternalName :: MonadIO m => m NameSource
Utility Functions
isNameDataConstructor :: Name -> BoolSource
Does the given Name correspond to a data type or a channel definition.