[GHC] #10382: Template Haskell quotes should work with stage 1 compiler
GHC
ghc-devs at haskell.org
Tue May 5 14:40:46 UTC 2015
#10382: Template Haskell quotes should work with stage 1 compiler
-------------------------------------+-------------------------------------
Reporter: ezyang | Owner: ezyang
Type: feature request | Status: new
Priority: normal | Milestone: 7.12.1
Component: Template Haskell | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions: Phab:D876
-------------------------------------+-------------------------------------
Comment (by ezyang):
To be clear, I am NOT suggesting quasi-quotes be supported by this; just
plain old brackets! (Apologies for the bad names; perhaps "expression
quotation" is a more accurate name?) With plain quotes, we don't have to
find and link `qq` with this complexity. See the diff that's been
attached, which I know works and is not all that complicated.
Whether or not the change is parochial, I think it relates to more than
just GHC; it applies to any platform where we can compile GHC, but dynamic
code loading is not supported (i.e. no GHCi support). Now, you might
wonder, "why would anyone need to use TH quotes, without any TH splices?"
but Edward Kmett gives an example of one such case, where he wants to put
his TH library code (no splices) in a main library, while still supporting
platforms without GHCi, without macroing the business.
Unusual? Maybe. But someone wants it, and it doesn't seem too hard to give
them, so let's do it!
If we don't like the language extension, we could alternate make
`TemplateHaskell` not immediately error on stage 1 compilation, and just
error when we actually reach a splice site.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10382#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list