
Johan:
I started writing a manual traversal of the RenamedSource AST (as I want qualified names) but I thought I check if I'm going about this right before I spend all the time required to write the traversal for the whole AST.
Manual traversal code on ASTs tends to consist mainly of boilerplate, so I'd like to emphasize Simon's suggestion: Simon:
You could even use generic programming to do it (all the Hs things are in class Data I think).
There is a page on the GHC wiki on generic AST traversals http://hackage.haskell.org/trac/ghc/wiki/GhcApiAstTraversals by now probably out of date (eg, the instances may now be available without needing ghc-syb, I think?), but it should get you started (using generic programming is a lot easier than trying to understand its types, you just need to make sure that your traversals avoid some holes in the GHC ASTs; there's a Data-based show variant that illustrates the idea), and you might be able to correct out-of-date info. Claus