Add support for Template Haskell state.