Developments in the GHC API
This page summarises changes to the GHC API that will make it easier for tool writers to use the GHC API.
- More parser entrypoints, to explicitly parse fragments (Andrew Gibiansky)
The following parsers are now provided
- No more landmines in the AST (Alan Zimmerman).
In the past it was difficult to work with the GHC AST as any generic traversals had to carefully tiptoe around an assortment of panic and undefined expressions. These have now been removed, by uses of
PostTc, etc, allowing standard traversal libraries to be used. See module
The relevant commit is
- Introduce an annotation structure to the
ParsedSourceto record the location of un-captured keywords (Alan Zimmerman).
At the moment the location of let / in / if / then / else / do etc is not captured in the AST. This makes it difficult to parse some source, transform the AST, and then output it again preserving the original layout.
Wiki page: ApiAnnotations
- Introduce a means to map
ParsedSourceto their corresponding
Wiki page: ApiNameMap