Commit Graph

4 Commits

Author SHA1 Message Date
Adam Sampson
7a7e3e2b24 Make GenNavAST generate instances of a "Polyplate" class.
This provides transformM, which we can build applyX (etc.) on top of:
it takes a set of functions, and applies them wherever they could
match in a data structure, without automatically recursing. This is
done using a four(!)-argument typeclass, drawing inspiration from
Biplate.

The resulting 25,000-line set of instances takes a little while to
compile...
2008-05-10 16:27:46 +00:00
Adam Sampson
058a3488d9 Generate instances of a Navigable class.
This isn't immediately useful, but I plan to build on it.
2008-05-09 15:46:18 +00:00
Adam Sampson
710be039cb Have the pregen programs figure out the types using generics.
Previously they had a list of the types they needed to generate
instances for.  This patch adds some helper code that can be used to
list all the AST.* types in the AST automatically. The result is that we
should be able to add new types to the AST without needing to change the
generator code.

This also means that GenOrdAST is now generating *all* the instances of
Ord for the AST; previously the trivial ones were derived by the
compiler.
2008-05-09 14:02:13 +00:00
Adam Sampson
9c77aed7b3 Move Gen* into their own directory. 2008-05-09 09:36:45 +00:00