cryptol-2.2.6: Cryptol: The Language of Cryptography

Copyright | (c) 2013-2015 Galois, Inc.
License | BSD3
Maintainer | cryptol@galois.com
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell98

Cryptol.ModuleSystem.NamingEnv

Description

Synopsis

- data NameOrigin
  - = Local (Located QName)
  - | Imported QName
- data EName
  - = EFromBind (Located QName)
  - | EFromNewtype (Located QName)
  - | EFromMod QName
- data TName
  - = TFromParam QName
  - | TFromSyn (Located QName)
  - | TFromNewtype (Located QName)
  - | TFromMod QName
- class HasQName a where
  - qname :: a -> QName
  - origin :: a -> NameOrigin
- data NamingEnv = NamingEnv {
  - neExprs :: Map QName [EName]
  - neTypes :: Map QName [TName]
  }
- singletonT :: QName -> TName -> NamingEnv
- singletonE :: QName -> EName -> NamingEnv
- shadowing :: NamingEnv -> NamingEnv -> NamingEnv
- travNamingEnv :: Applicative f => (QName -> f QName) -> NamingEnv -> f NamingEnv
- class BindsNames a where
  - namingEnv :: a -> NamingEnv

# Documentation

data NameOrigin Source

Constructors

Local (Located QName) |
Imported QName |

Instances

Show NameOrigin Source |
PP NameOrigin Source |

data EName Source

Constructors

EFromBind (Located QName) |
EFromNewtype (Located QName) |
EFromMod QName |

Instances

Show EName Source |
HasQName EName Source |

data TName Source

Constructors

TFromParam QName |
TFromSyn (Located QName) |
TFromNewtype (Located QName) |
TFromMod QName |

Instances

Show TName Source |
HasQName TName Source |

class HasQName a where Source

Methods

qname :: a -> QName Source

origin :: a -> NameOrigin Source

Instances

HasQName TName Source |
HasQName EName Source |

data NamingEnv Source

Constructors

NamingEnv |

Fields

neExprs :: Map QName [EName]

  Expr renaming environment

neTypes :: Map QName [TName]

  Type renaming environment

Instances

Show NamingEnv Source |
Monoid NamingEnv Source |
BindsNames NamingEnv Source |

singletonT :: QName -> TName -> NamingEnv Source

Singleton type renaming environment.

singletonE :: QName -> EName -> NamingEnv Source

Singleton expression renaming environment.

shadowing :: NamingEnv -> NamingEnv -> NamingEnv Source

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

travNamingEnv :: Applicative f => (QName -> f QName) -> NamingEnv -> f NamingEnv Source

class BindsNames a where Source

Things that define exported names.

Methods

namingEnv :: a -> NamingEnv Source

Instances

BindsNames TParam Source | Generate the naming environment for a type parameter.
BindsNames Schema Source | Generate a type renaming environment from the parameters that are bound by this schema.
BindsNames Pattern Source | Generate an expression renaming environment from a pattern. This ignores type parameters that can be bound by the pattern.
BindsNames Match Source | Translate names bound by the patterns of a match into a renaming environment.
BindsNames Bind Source |
BindsNames Decl Source | The naming environment for a single declaration, unqualified. This is meanat to be used for things like where clauses.
BindsNames Module Source | The naming environment for a single module. This is the mapping from unqualified internal names to fully qualified names.
BindsNames IfaceDecls Source | Translate a set of declarations from an interface into a naming environment.
BindsNames Iface 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 |