|Reported by:||GregWeber||Owned by:|
|Type of failure:||None/Unknown||Test Case:|
|Related Tickets:||Differential Rev(s):||Phab:D518|
I am proposing an additional feature, -ddump-splices-file that generates a corresponding .hs.th file for every .hs file that uses Template Haskell.
-ddump-splices is an invaluable but a frustrating way to look at generated Haskell code. If TH generation were some kind of error message, the current output would make sense. However, TH is generating code that we rely on and would be easier to comprehend if we could see it in a way the most similar to our existing Haskell code.
There is a valid complaint that when TH defines something you can't just grep for it, you have to know what TH is defining by reading documentation and imagining something that isn't in front of you.
If you have a file Foo.hs -ddump-splices-file will generate Foo.hs.th. Then whenever someone greps after buliding they will find the declaration. If you check these files in they can grep even before building. Similarly, an IDE can show these files as the source of a declaration. Also, if the TH generation changes in some way when a TH function changes, that will be visible.
This seems like a relatively easy feature to add. Any pointers on where to get started?
Change History (26)
comment:18 Changed 22 months ago by GregWeber
- Differential Rev(s) set to https://phabricator.haskell.org/D518
- Status changed from new to patch
comment:24 Changed 21 months ago by thoughtpolice
- Differential Rev(s) changed from https://phabricator.haskell.org/D518 to Phab:D518
- Milestone set to 7.10.1