cryptol-2.3.0: Cryptol: The Language of Cryptography

Copyright(c) 2013-2016 Galois, Inc.
LicenseBSD3
Maintainercryptol@galois.com
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Cryptol.ModuleSystem.NamingEnv

Description

 

Synopsis

Documentation

data NamingEnv Source

Constructors

NamingEnv 

Fields

neExprs :: Map PName [Name]

Expr renaming environment

neTypes :: Map PName [Name]

Type renaming environment

neFixity :: Map Name Fixity

Expression-level fixity environment

merge :: [Name] -> [Name] -> [Name] Source

Merge two name maps, collapsing cases where the entries are the same, and producing conflicts otherwise.

toPrimMap :: NamingEnv -> PrimMap Source

Generate a mapping from Ident to Name for a given naming environment.

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.

singletonT :: PName -> Name -> NamingEnv Source

Singleton type renaming environment.

singletonE :: PName -> Name -> NamingEnv Source

Singleton expression renaming environment.

shadowing :: NamingEnv -> NamingEnv -> NamingEnv Source

Like mappend, but when merging, prefer values on the lhs.

namingEnv' :: BindsNames a => a -> Supply -> (NamingEnv, Supply) Source

Generate a NamingEnv using an explicit supply.

class BindsNames a where Source

Things that define exported names.

Instances

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

Constructors

ImportIface Import Iface 

Instances

BindsNames ImportIface Source

Produce a naming environment from an interface file, that contains a mapping only from unqualified names to qualified ones.