Copyright | (c) 2013-2015 Galois, Inc. |
---|---|
License | BSD3 |
Maintainer | cryptol@galois.com |
Stability | provisional |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
- data NamingEnv
- shadowing :: NamingEnv -> NamingEnv -> NamingEnv
- class BindsNames a where
- checkNamingEnv :: NamingEnv -> ([RenamerError], [RenamerWarning])
- class Rename a where
- rename :: a -> RenameM a
- runRenamer :: NamingEnv -> RenameM a -> (Either [RenamerError] a, [RenamerWarning])
- data RenamerError
- data RenamerWarning = SymbolShadowed NameOrigin [NameOrigin]
Documentation
shadowing :: NamingEnv -> NamingEnv -> NamingEnv Source
Like mappend, but when merging, prefer values on the lhs.
class BindsNames a where Source
Things that define exported names.
BindsNames TParam | Generate the naming environment for a type parameter. |
BindsNames Schema | Generate a type renaming environment from the parameters that are bound by this schema. |
BindsNames Pattern | Generate an expression renaming environment from a pattern. This ignores type parameters that can be bound by the pattern. |
BindsNames Match | Translate names bound by the patterns of a match into a renaming environment. |
BindsNames Bind | |
BindsNames Decl | The naming environment for a single declaration, unqualified. This is meanat to be used for things like where clauses. |
BindsNames Module | The naming environment for a single module. This is the mapping from unqualified internal names to fully qualified names. |
BindsNames IfaceDecls | Translate a set of declarations from an interface into a naming environment. |
BindsNames Iface | Produce a naming environment from an interface file, that contains a mapping only from unqualified names to qualified ones. |
BindsNames NamingEnv | |
BindsNames a => BindsNames [a] | |
BindsNames a => BindsNames (Maybe a) |
checkNamingEnv :: NamingEnv -> ([RenamerError], [RenamerWarning]) Source
Throw errors for any names that overlap in a rewrite environment.
Rename Prop | |
Rename Type | |
Rename Schema | Rename a schema, assuming that none of its type variables are already in scope. |
Rename Pattern | |
Rename Match | |
Rename TypeInst | |
Rename Expr | |
Rename Newtype | |
Rename Pragma | |
Rename Bind | Rename a binding. NOTE: this does not bind its own name into the naming context of its body. The assumption here is that this has been done by the enclosing environment, to allow for top-level renaming |
Rename TySyn | |
Rename Decl | |
Rename TopDecl | |
Rename Module | |
Rename a => Rename [a] | |
Rename a => Rename (Maybe a) | |
Rename a => Rename (Located a) | |
Rename a => Rename (Named a) | |
Rename a => Rename (TopLevel a) |
runRenamer :: NamingEnv -> RenameM a -> (Either [RenamerError] a, [RenamerWarning]) Source
data RenamerError Source
MultipleSyms (Located QName) [NameOrigin] | Multiple imported symbols contain this name |
UnboundExpr (Located QName) | Expression name is not bound to any definition |
UnboundType (Located QName) | Type name is not bound to any definition |
OverlappingSyms [NameOrigin] | An environment has produced multiple overlapping symbols |
ExpectedValue (Located QName) | When a value is expected from the naming environment, but one or more types exist instead. |
ExpectedType (Located QName) | When a type is missing from the naming environment, but one or more values exist with the same name. |