The solution using Template Haskell pretty printer can be found here: Preferred method for viewing code generated by Template Haskell
There are also other tools, as answered to a question here: How to create a non-TH package from code generated using Template Haskell?
The result of -ddump-splices
is not always valid haskell code, it is only for the programmer.