
I tried to implement symbolic differentation using GHC's simplification rules. I assume that someone has already thought about this, right?
You are trying to do 'intensional programming' via GHC's simplification rules, ouch! You are likely to hit limits very very quickly. However, if you want to do this *in* GHC, then Oleg showed how to do it in the post http://www.haskell.org/pipermail/haskell/2004-November/014939.html
I have also heard that the rules system is not strong enough for implementing a full computer algebra system.
That might be because CASes cannot be done as (unconditional) rewrite systems! With 'conditional' TRS you can get much further, but the condition-checking may involve arbitrary theorem proving. I also attach a minor variation of Oleg's code in which all the Num dependencies are removed(!) and replaced by the much weaker Show dependence. Jacques