[Haskell] ANNOUNCE: string-qq-0.0.2

Ben Millwood haskell at benmachine.co.uk
Wed Jun 29 18:28:17 CEST 2011


2011/6/28 Steffen Schuldenzucker <sschuldenzucker at uni-bonn.de>:
> Btw., does TH parse this correctly? (If I was TH, I would not):
>
>> myPHPCode = [s|
>> <?php
>> $description = "Use the quasiquoter like this: [s|some text|]";
>> print $description."\n";
>> ?>
>> |]
>
> (the tricky part is "|]" occurring in the quoted text)
>
> Can we escape it?
>
> -- Steffen
>

I once spent some time and energy making [foo| bar baz |\] quux |] do
the right thing for a quasiquoter I implemented, only to discover that
GHC already supports [foo| bar baz \|] quux |]. So yes, you can escape
it.



More information about the Haskell mailing list