One interesting detour I took this last month was writing a toy Haskell Symbolic Algebra library, HaskSymb. It takes advantage of Quasi-Quoters and View Patterns to do awesome math pattern matching and enable one to write beautiful code. An example of its use: The interesting part, however, is the code for expand, collectTerms and friends. […]