Safe Haskell | None |
---|
Names used by the evaluator. This is heavily inspired by GHC.
- data OccName = OccName String
- data UnRenamedName
- data Name = Name {}
- data NameType
- mkExternalName :: MonadIO m => UnRenamedName -> SrcSpan -> Bool -> m Name
- mkInternalName :: MonadIO m => UnRenamedName -> SrcSpan -> m Name
- mkWiredInName :: MonadIO m => UnRenamedName -> 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.
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
mkExternalName :: MonadIO m => UnRenamedName -> SrcSpan -> Bool -> m NameSource
mkInternalName :: MonadIO m => UnRenamedName -> SrcSpan -> m NameSource
mkWiredInName :: MonadIO m => UnRenamedName -> Bool -> m NameSource
mkFreshInternalName :: MonadIO m => m NameSource
Utility Functions
isNameDataConstructor :: Name -> BoolSource
Does the given Name correspond to a data type or a channel definition.