Safe Haskell | None |
---|---|
Language | Haskell2010 |
Analyse variables/function names and produce unique names that can be used to replace the original names while maintaining program equivalence (a.k.a. alpha-conversion). The advantage of the unique names is that scoping issues can be ignored when doing further analysis.
- analyseRenames :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a)
- analyseRenamesWithModuleMap :: Data a => ModuleMap -> ProgramFile (Analysis a) -> ProgramFile (Analysis a)
- rename :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a)
- unrename :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a)
- type ModuleMap = Map ProgramUnitName ModEnv
- extractNameMap :: Data a => ProgramFile (Analysis a) -> NameMap
- renameAndStrip :: Data a => ProgramFile (Analysis a) -> (NameMap, ProgramFile a)
- underRenaming :: (Data a, Data b) => (ProgramFile (Analysis a) -> b) -> ProgramFile a -> b
- type NameMap = Map String String
Documentation
analyseRenames :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) Source #
Annotate unique names for variable and function declarations and uses.
analyseRenamesWithModuleMap :: Data a => ModuleMap -> ProgramFile (Analysis a) -> ProgramFile (Analysis a) Source #
Annotate unique names for variable and function declarations and uses. With external module map.
rename :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) Source #
Take the unique name annotations and substitute them into the actual AST.
unrename :: Data a => ProgramFile (Analysis a) -> ProgramFile (Analysis a) Source #
Take a renamed program and undo the renames.
extractNameMap :: Data a => ProgramFile (Analysis a) -> NameMap Source #
DEPRECATED: Create a map of unique name => original name for each variable and function in the program.
renameAndStrip :: Data a => ProgramFile (Analysis a) -> (NameMap, ProgramFile a) Source #
DEPRECATED: Perform the rename, stripAnalysis, and extractNameMap functions.
underRenaming :: (Data a, Data b) => (ProgramFile (Analysis a) -> b) -> ProgramFile a -> b Source #
DEPRECATED: Run a function with the program file placed under renaming analysis, then undo the renaming in the result of the function.