[GHC] #8624: -ddump-splices-file

GHC ghc-devs at haskell.org
Mon Dec 23 02:01:18 UTC 2013


#8624: -ddump-splices-file
------------------------------------+-------------------------------------
       Reporter:  GregWeber         |             Owner:
           Type:  feature request   |            Status:  new
       Priority:  normal            |         Milestone:
      Component:  Compiler          |           Version:  7.6.3
       Keywords:                    |  Operating System:  Unknown/Multiple
   Architecture:  Unknown/Multiple  |   Type of failure:  None/Unknown
     Difficulty:  Unknown           |         Test Case:
     Blocked By:                    |          Blocking:
Related Tickets:                    |
------------------------------------+-------------------------------------
 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?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8624>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list