[Template-haskell] TH preprocessing

Wolfgang Jeltsch wolfgang at jeltsch.net
Mon May 10 22:55:21 EDT 2004


Am Montag, 10. Mai 2004 10:29 schrieben Sie:
> Not at present.  It's actually a little trickier than it looks, because
> the post-type-checked program (with the splices expanded) has dictionary
> stuff floating around, and it's not entirely straightforward to convert
> it back to vanilla source Haskell.

If I understood TH correctly, the expressions after the "splice operator" $ 
describe vanilla source Haskell.  And I assumed that it's this vanilla source 
code which -ddump-splices outputs. (I've never checked this myself.)  So why 
isn't it possible to replace the splice parts in the *original* Haskell 
source file with the outputs of -ddump-splices?  This could be done via some 
search and replace at the text level though this is, of course, not very 
elegant.

> [...]

Wolfgang



More information about the template-haskell mailing list