Datatype Manipulation with Template Haskell
http://hackage.haskell.org/package/thorn
Thorn is a datatype manipulation library, implemented using Template Haskell. It's uploaded in Hackage and you can install it with Cabal.
It generates
-
functors from various kinds of datatypes, regardless of its arity or variances.
-
folds and unfolds from various kinds of recursive datatypes, including mutually recursive ones.
A single function of Thorn will give you a lot. Just try it.