title: How to build Abstract Syntax Trees from grammar specification in Haskell?
body: <p>I'm working on a project which involves optimizing certain constructs in a very small subset of Java, formalized in BNF. </p>
  
  <p>If I were to do this in Java, I would use a combination of JTB and JavaCC which builds an AST. Visitors are then used to manipulate the tree. But, given the vast libraries for parsing in Haskell (parsec, happy, alex etc), I'm a bit confused in chossing the appropriate library.</p>
  
  <p>So, simply put, when a language is specified in BNF, which library offers the easiest means to build an AST? And what is the best way to go about modifying this tree in idiomatic Haskell?</p>