cryptol-2.9.1: Cryptol: The Language of Cryptography

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

Cryptol.ModuleSystem.NamingEnv

Description

 
Synopsis

Documentation

data NamingEnv Source #

The NamingEnv is used by the renamer to determine what identifiers refer to.

Constructors

NamingEnv 

Fields

Instances
Show NamingEnv Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

Generic NamingEnv Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

Associated Types

type Rep NamingEnv :: Type -> Type #

Semigroup NamingEnv Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

Monoid NamingEnv Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

NFData NamingEnv Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

Methods

rnf :: NamingEnv -> () #

BindsNames NamingEnv Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

type Rep NamingEnv Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

type Rep NamingEnv = D1 (MetaData "NamingEnv" "Cryptol.ModuleSystem.NamingEnv" "cryptol-2.9.1-EDtcoHURvveHmx5M6ZZjMK" False) (C1 (MetaCons "NamingEnv" PrefixI True) (S1 (MetaSel (Just "neExprs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Map PName [Name])) :*: S1 (MetaSel (Just "neTypes") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Map PName [Name]))))

lookupValNames :: PName -> NamingEnv -> [Name] Source #

Return a list of value-level names to which this parsed name may refer.

lookupTypeNames :: PName -> NamingEnv -> [Name] Source #

Return a list of type-level names to which this parsed name may refer.

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 PrimIdent 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.

data InModule a Source #

Constructors

InModule !ModName a 
Instances
Functor InModule Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

Methods

fmap :: (a -> b) -> InModule a -> InModule b #

(<$) :: a -> InModule b -> InModule a #

Foldable InModule Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

Methods

fold :: Monoid m => InModule m -> m #

foldMap :: Monoid m => (a -> m) -> InModule a -> m #

foldr :: (a -> b -> b) -> b -> InModule a -> b #

foldr' :: (a -> b -> b) -> b -> InModule a -> b #

foldl :: (b -> a -> b) -> b -> InModule a -> b #

foldl' :: (b -> a -> b) -> b -> InModule a -> b #

foldr1 :: (a -> a -> a) -> InModule a -> a #

foldl1 :: (a -> a -> a) -> InModule a -> a #

toList :: InModule a -> [a] #

null :: InModule a -> Bool #

length :: InModule a -> Int #

elem :: Eq a => a -> InModule a -> Bool #

maximum :: Ord a => InModule a -> a #

minimum :: Ord a => InModule a -> a #

sum :: Num a => InModule a -> a #

product :: Num a => InModule a -> a #

Traversable InModule Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

Methods

traverse :: Applicative f => (a -> f b) -> InModule a -> f (InModule b) #

sequenceA :: Applicative f => InModule (f a) -> f (InModule a) #

mapM :: Monad m => (a -> m b) -> InModule a -> m (InModule b) #

sequence :: Monad m => InModule (m a) -> m (InModule a) #

Show a => Show (InModule a) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

Methods

showsPrec :: Int -> InModule a -> ShowS #

show :: InModule a -> String #

showList :: [InModule a] -> ShowS #

BindsNames (InModule (PrimType PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (Newtype PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (Bind PName)) Source #

Introduce the name

Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (ParameterFun PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (ParameterType PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (Decl PName)) Source #

The naming environment for a single declaration.

Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (TopDecl PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

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.

Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames NamingEnv Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames a => BindsNames [a] Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

Methods

namingEnv :: [a] -> BuildNamingEnv Source #

BindsNames a => BindsNames (Maybe a) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (TParam PName) Source #

Generate the naming environment for a type parameter.

Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (Schema PName) Source #

Generate a type renaming environment from the parameters that are bound by this schema.

Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (Module PName) Source #

The naming environment for a single module. This is the mapping from unqualified names to fully qualified names with uniques.

Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (PrimType PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (Newtype PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (Bind PName)) Source #

Introduce the name

Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (ParameterFun PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (ParameterType PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (Decl PName)) Source #

The naming environment for a single declaration.

Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

BindsNames (InModule (TopDecl PName)) Source # 
Instance details

Defined in Cryptol.ModuleSystem.NamingEnv

interpImport Source #

Arguments

:: Import

The import declarations

-> IfaceDecls

Declarations of imported module

-> NamingEnv 

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.

modParamsNamingEnv :: IfaceParams -> NamingEnv Source #

Compute an unqualified naming environment, containing the various module parameters.

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.

Instance details

Defined in Cryptol.ModuleSystem.NamingEnv