Safe Haskell | None |
---|
Abstract names carry unique identifiers and stuff.
- data Name = Name {}
- data QName = QName {}
- data QNamed a = QNamed {}
- newtype ModuleName = MName {
- mnameToList :: [Name]
- newtype AmbiguousQName = AmbQ {}
- isAnonymousModuleName :: ModuleName -> Bool
- withRangesOf :: ModuleName -> [Name] -> ModuleName
- withRangesOfQ :: ModuleName -> QName -> ModuleName
- mnameFromList :: [Name] -> ModuleName
- noModuleName :: ModuleName
- mkName :: Range -> NameId -> String -> Name
- mkName_ :: NameId -> String -> Name
- qnameToList :: QName -> [Name]
- qnameFromList :: [Name] -> QName
- qnameToMName :: QName -> ModuleName
- mnameToQName :: ModuleName -> QName
- showQNameId :: QName -> String
- qnameToConcrete :: QName -> QName
- mnameToConcrete :: ModuleName -> QName
- toTopLevelModuleName :: ModuleName -> TopLevelModuleName
- qualifyM :: ModuleName -> ModuleName -> ModuleName
- qualifyQ :: ModuleName -> QName -> QName
- qualify :: ModuleName -> Name -> QName
- isOperator :: QName -> Bool
- isSubModuleOf :: ModuleName -> ModuleName -> Bool
- isInModule :: QName -> ModuleName -> Bool
- freshName :: (MonadState s m, HasFresh NameId s) => Range -> String -> m Name
- freshName_ :: (MonadState s m, HasFresh NameId s) => String -> m Name
- freshNoName :: (MonadState s m, HasFresh NameId s) => Range -> m Name
- freshNoName_ :: (MonadState s m, HasFresh NameId s) => m Name
- nextName :: Name -> Name
- class IsNoName a where
Documentation
A name is a unique identifier and a suggestion for a concrete name. The concrete name contains the source location (if any) of the name. The source location of the binding site is also recorded.
Name | |
|
Eq Name | |
Ord Name | |
Show Name | |
Typeable Name | |
Hashable Name | |
KillRange Name | |
SetRange Name | |
HasRange Name | |
IsNoName Name | An abstract name is empty if its concrete name is empty. |
Subst Name | |
AddContext Name | |
PrettyTCM Name | |
InstantiateFull Name | |
EmbPrj Name | |
ToConcrete Name Name | |
Reify Name Name | |
AddContext (Dom (Name, Type)) | |
ToAbstract (NewName Name) Name | |
ToAbstract (NewName BoundName) Name | |
(Free i, Reify i a) => Reify (Abs i) (Name, a) | |
AddContext ([Name], Dom Type) | |
AddContext (Name, Dom Type) |
Qualified names are non-empty lists of names. Equality on qualified names are just equality on the last name, i.e. the module part is just for show.
The SetRange
instance for qualified names sets all individual
ranges (including those of the module prefix) to the given one.
QName | |
|
Something preceeded by a qualified name.
newtype ModuleName Source
A module name is just a qualified name.
The SetRange
instance for module names sets all individual ranges
to the given one.
MName | |
|
newtype AmbiguousQName Source
Ambiguous qualified names. Used for overloaded constructors.
Invariant: All the names in the list must have the same concrete, unqualified name.
isAnonymousModuleName :: ModuleName -> BoolSource
A module is anonymous if the qualification path ends in an underscore.
withRangesOf :: ModuleName -> [Name] -> ModuleNameSource
Sets the ranges of the individual names in the module name to
match those of the corresponding concrete names. If the concrete
names are fewer than the number of module name name parts, then the
initial name parts get the range noRange
.
C.D.E `withRangesOf` [A, B]
returns C.D.E
but with ranges set
as follows:
-
C
:noRange
. -
D
: the range ofA
. -
E
: the range ofB
.
Precondition: The number of module name name parts has to be at least as large as the length of the list.
withRangesOfQ :: ModuleName -> QName -> ModuleNameSource
Like withRangesOf
, but uses the name parts (qualifier + name)
of the qualified name as the list of concrete names.
mnameFromList :: [Name] -> ModuleNameSource
mkName :: Range -> NameId -> String -> NameSource
The Range
sets the definition site of the name, not the use site.
qnameToList :: QName -> [Name]Source
qnameFromList :: [Name] -> QNameSource
showQNameId :: QName -> StringSource
qnameToConcrete :: QName -> QNameSource
Turn a qualified name into a concrete name. This should only be used as a fallback when looking up the right concrete name in the scope fails.
toTopLevelModuleName :: ModuleName -> TopLevelModuleNameSource
Computes the TopLevelModuleName
corresponding to the given
module name, which is assumed to represent a top-level module name.
Precondition: The module name must be well-formed.
qualifyM :: ModuleName -> ModuleName -> ModuleNameSource
qualifyQ :: ModuleName -> QName -> QNameSource
qualify :: ModuleName -> Name -> QNameSource
isOperator :: QName -> BoolSource
Is the name an operator?
isSubModuleOf :: ModuleName -> ModuleName -> BoolSource
isInModule :: QName -> ModuleName -> BoolSource
freshName_ :: (MonadState s m, HasFresh NameId s) => String -> m NameSource
freshNoName :: (MonadState s m, HasFresh NameId s) => Range -> m NameSource
freshNoName_ :: (MonadState s m, HasFresh NameId s) => m NameSource