
Chris Kuklewicz
I played with such things, as seen on the old wiki: http://haskell.org/hawiki/ShortExamples_2fSymbolDifferentiation
Cool hack! What is the use of a GADT buying in this example? Replacing the GADT with the seemingly equivalent non-GADT declaration (**) (and adding Simplify b to the context of reflectVar) seems to yield the same results. thanks -m ** data Simplify a => T a = -- Base Var SymName | Simplify a => Const a -- Num | Add [T a] | Mul [T a] | Sub (T a) (T a) | Neg (T a) | Abs (T a) | SigNum (T a) -- Fractional | Div (T a) (T a) | Recip (T a) -- Floating | Exp (T a) | Sqrt (T a) | Log (T a) | Pow (T a) (T a) | LogBase (T a) (T a) | Sin (T a) | Cos (T a)