Café,
I've tried several things already, but I am not including any of them for now.
My question is, how would you define the 'transform' function for a GADT, say the one in the linked gist: http://gist.github.com/492364 (also attached to this e-mail)
To be concise, I want 'transform' to apply the transformation function (its first parameter) to every immidiate child of its second parameter as long as the types match. Similar to what the 'tranform' function of Uniplate does for normal ADTs. (But just one level, so I guess it is more similar to the 'descend' of Uniplate. See http://hackage.haskell.org/packages/archive/uniplate/1.2.0.1/doc/html/Data-Generics-UniplateStr.html)
I think I got closest to a sensible solution using multi-param type classes, and defining many instances for different combinations of ExprType's but still there were problems.
Waiting for suggestions and/or insights.
Best,
Ozgur Akgun