[GHC] #4372: Extending quasiquotation support
GHC
ghc-devs at haskell.org
Thu Feb 26 23:01:11 UTC 2015
#4372: Extending quasiquotation support
-------------------------------------+-------------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.12.1
Component: Template Haskell | Version: 6.12.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: None/Unknown | Unknown/Multiple
Blocked By: | Test Case:
Related Tickets: | Blocking:
| Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by gershomb):
At this point I consider this a "nice idea" but I'm not sure how to modify
the parser to handle it within the many grammatical constraints we already
have. The somewhat clunky syntax that was pointed out by Simon upthread is
actually adequate for this. This, for example is the style adopted by
Manuel's language-c-inline:
{{{
nslog msg = $(objc ['msg :> ''String] (void [cexp| NSLog(@"Here is a
message from Haskell: %@", msg) |]))
}}}
Here, we use the quasiquoter to capture the expression, and then embed
that quasiquoted expression itself within a TH block, in order to pass in
additional information during codegen.
If a lighter-weight syntax was possible, I'd remain all for it. But, I
honestly can't think how to provide it given the constraints we have -- my
patch at the time didn't really solve the problem, and I haven't had any
better ideas since :-)
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/4372#comment:19>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list