#5348: Template Haskell quasiquote escapes
---------------------------------+------------------------------------------
    Reporter:  simonpj           |        Owner:              
        Type:  feature request   |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  7.0.3       
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------
Changes (by snoyberg):

 * cc: michael@… (added)


Comment:

 Just wanted to mention that I actually ran into this issue in the past.
 The Yesod scaffolder produces a number of Haskell files, some of which
 include quasiquotes. And in an older version, I specified the code within
 a quasiquote itself, so I needed a way to allow |] to show up within the
 content of the QQ.

 The work-around I implemented was to hardcode a value (I think ~~, I'm not
 certain at this point) that would be completely ignored by the
 quasiquoter. This worked out very well and was simple to implement. Since
 then, I've moved from QQ to an external file (via qRunIO and readFile) for
 the same effect and have been able to avoid this hack.

 I'm probably one of the biggest (ab)users of QQ, and this hasn't been an
 issue that's bitten me too much. If it stays "broken" as is, I won't shed
 any tears. But I would prefer not implementing some kind of arbitrary
 escape mechanism within QQ. We already use a bit of backslash escaping
 within Hamlet, and if the QQ mechanism itself *also* did backslash
 escaping, code would get ugly (not to mention breakage between GHC
 versions).

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5348#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to