Skip to content

Latest commit

 

History

History
5 lines (4 loc) · 1.81 KB

File metadata and controls

5 lines (4 loc) · 1.81 KB

Improving the Haskell-tools framework

  • Need a helper for pattern matching on a part of the AST? If a pattern match you need is missing, you can write it in the module that corresponds to the kind of AST element you are using. The pattern matching modules can be found in the haskell-tools-rewrite package, and are named Language.Haskell.Tools.Rewrite.Create.*.
  • Need a generator to create a new AST? If an AST generator function you need is missing, you can write it in the module that corresponds to the kind of AST element you are using. The pattern matching modules can be found in the haskell-tools-rewrite package, and are named Language.Haskell.Tools.Rewrite.Match.*.
  • Need a new kind of semantic information for analysis or refactoring? The types of semantic information available in the AST are defined in the SemaInfoTypes module, and their corresponding classes are in SemaInfoClasses. The classes are used to hide the concrete data structures that store the semantic information and to allow the same information to be accessed from multiple elements. However if you need a new semantic information you have to get it from GHC while a module is being compiled. For example name information is extracted from the GHC AST in the FromGHC.Names module