Hi Ron,
I've attached a revised file that solves your problem.
The solution is actually quite subtle. If you define the class as:
class Functor f => Printable f where
exprDoc :: f t -> Doc
you can't make recursive calls to sub-expressions. There is, after
all, no reason to believe that "t"
Here's something that should be an easy extension of Wouter's approach
to extensible datatypes, but I'm failing (possibly since it's 2:20am).
I several classes of expressions I'm trying to represent (thus,
Wouter's approach), and my first operation to implement over them is
printing.
Attached is