Copyright | (c) 2013-2016 Galois Inc. |
---|---|
License | BSD3 |
Maintainer | cryptol@galois.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell98 |
- data NamingEnv = NamingEnv {}
- merge :: [Name] -> [Name] -> [Name]
- toPrimMap :: NamingEnv -> PrimMap
- toNameDisp :: NamingEnv -> NameDisp
- visibleNames :: NamingEnv -> (Set Name, Set Name)
- qualify :: ModName -> NamingEnv -> NamingEnv
- filterNames :: (PName -> Bool) -> NamingEnv -> NamingEnv
- singletonT :: PName -> Name -> NamingEnv
- singletonE :: PName -> Name -> NamingEnv
- shadowing :: NamingEnv -> NamingEnv -> NamingEnv
- travNamingEnv :: Applicative f => (Name -> f Name) -> NamingEnv -> f NamingEnv
- data InModule a = InModule !ModName a
- namingEnv' :: BindsNames a => a -> Supply -> (NamingEnv, Supply)
- newtype BuildNamingEnv = BuildNamingEnv {}
- class BindsNames a where
- interpImport :: Import -> IfaceDecls -> NamingEnv
- unqualifiedEnv :: IfaceDecls -> NamingEnv
- data ImportIface = ImportIface Import Iface
Documentation
merge :: [Name] -> [Name] -> [Name] Source #
Merge two name maps, collapsing cases where the entries are the same, and producing conflicts otherwise.
toNameDisp :: NamingEnv -> NameDisp Source #
Generate a display format based on a naming environment.
visibleNames :: NamingEnv -> (Set Name, Set Name) Source #
Produce sets of visible names for types and declarations.
NOTE: if entries in the NamingEnv would have produced a name clash, they will be omitted from the resulting sets.
qualify :: ModName -> NamingEnv -> NamingEnv Source #
Qualify all symbols in a NamingEnv
with the given prefix.
shadowing :: NamingEnv -> NamingEnv -> NamingEnv Source #
Like mappend, but when merging, prefer values on the lhs.
travNamingEnv :: Applicative f => (Name -> f Name) -> NamingEnv -> f NamingEnv Source #
Functor InModule Source # | |
Foldable InModule Source # | |
Traversable InModule Source # | |
Show a => Show (InModule a) Source # | |
BindsNames (InModule (Newtype PName)) Source # | |
BindsNames (InModule (Bind PName)) Source # | Introduce the name |
BindsNames (InModule (Decl PName)) Source # | The naming environment for a single declaration. |
BindsNames (InModule (TopDecl PName)) Source # | |
namingEnv' :: BindsNames a => a -> Supply -> (NamingEnv, Supply) Source #
Generate a NamingEnv
using an explicit supply.
newtype BuildNamingEnv Source #
class BindsNames a where Source #
Things that define exported names.
namingEnv :: a -> BuildNamingEnv Source #
BindsNames ImportIface Source # | Produce a naming environment from an interface file, that contains a mapping only from unqualified names to qualified ones. |
BindsNames NamingEnv Source # | |
BindsNames a => BindsNames [a] Source # | |
BindsNames a => BindsNames (Maybe a) Source # | |
BindsNames (TParam PName) Source # | Generate the naming environment for a type parameter. |
BindsNames (Schema PName) Source # | Generate a type renaming environment from the parameters that are bound by this schema. |
BindsNames (Module PName) Source # | The naming environment for a single module. This is the mapping from unqualified names to fully qualified names with uniques. |
BindsNames (InModule (Newtype PName)) Source # | |
BindsNames (InModule (Bind PName)) Source # | Introduce the name |
BindsNames (InModule (Decl PName)) Source # | The naming environment for a single declaration. |
BindsNames (InModule (TopDecl PName)) Source # | |
interpImport :: Import -> IfaceDecls -> NamingEnv Source #
Interpret an import in the context of an interface, to produce a name
environment for the renamer, and a NameDisp
for pretty-printing.
unqualifiedEnv :: IfaceDecls -> NamingEnv Source #
Generate a naming environment from a declaration interface, where none of the names are qualified.
data ImportIface Source #
BindsNames ImportIface Source # | Produce a naming environment from an interface file, that contains a mapping only from unqualified names to qualified ones. |