> http://www.well-typed.com/blog/84/

Thank you! It's the kind of solution I was looking for.
Apparently I'll have to wait for GHC 7.10.