<div><span style>(oops, sorry, didn&#39;t do reply to all)</span></div><span style><div><span style><br></span></div>I use haskell-src-meta in QuasiText (on hackage) also. It would certainly be nice to have &quot;native&quot; anti-quotations, but for now haskell-src-meta does a very good job.</span><div>
<font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">Mike</font><div class="yj6qo ajU" style><span style="background-color:transparent">On Sat, May 26, 2012 at 8:31 AM, Geoffrey Mainland </span><span dir="ltr" style="background-color:transparent">&lt;<a href="mailto:mainland@apeiron.net" target="_blank">mainland@apeiron.net</a>&gt;</span><span style="background-color:transparent"> wrote:</span></div>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 05/25/2012 21:46, Antoine Latter wrote:<br>
&gt; On Fri, May 25, 2012 at 2:51 PM, Sam Lindley &lt;<a href="mailto:Sam.Lindley@ed.ac.uk">Sam.Lindley@ed.ac.uk</a>&gt; wrote:<br>
&gt;&gt; Template Haskell supports antiquotation for built-in quasiquotes, e.g.:<br>
&gt;&gt;<br>
&gt;&gt;  [| \x -&gt; x + $([|3 * 4|]) |]<br>
&gt;&gt;<br>
&gt;&gt; However, as far as I can tell, there is no way of supporting antiquotation<br>
&gt;&gt; in user-defined quasiquoters, because the only way to specify a new<br>
&gt;&gt; quasiquoter is through a quoteExp function of type String -&gt; Q Exp. Of<br>
&gt;&gt; course, it is perfectly possible to write a parser for some fragment of<br>
&gt;&gt; Haskell inside your quoteExp function, but that seems crazy given that<br>
&gt;&gt; Template Haskell or rather GHC already implements a parser for the whole<br>
&gt;&gt; language.<br>
&gt;&gt;<br>
&gt;&gt; I know about Language.Haskell.Exts.Parser in haskell-src-exts, which<br>
&gt;&gt; provides parseExp :: String -&gt; ParseResult Exp, but that Exp is a different<br>
&gt;&gt; type to the one provided by Template<br>
&gt;&gt; Haskell.&lt;<a href="http://hackage.haskell.org/packages/archive/haskell-src-exts/1.9.0/doc/html/Language-Haskell-Exts-Syntax.html#t:Exp" target="_blank">http://hackage.haskell.org/packages/archive/haskell-src-exts/1.9.0/doc/html/Language-Haskell-Exts-Syntax.html#t:Exp</a>&gt;<br>

&gt;&gt; I&#39;m also aware of Dominic Orchard&#39;s syntax-trees package, which supports<br>
&gt;&gt; converting between the two representations using a cunning hack that<br>
&gt;&gt; pretty-prints the haskell-src-exts representation to a string and uses<br>
&gt;&gt; Template Haskell to parse it back.<br>
&gt;&gt;<br>
&gt;&gt; Is there a saner way of simulating antiquotation in user-defined<br>
&gt;&gt; quasiquoters?<br>
&gt;&gt;<br>
&gt;<br>
&gt; Have you looked at:<br>
&gt;<br>
&gt; <a href="http://hackage.haskell.org/package/haskell-src-exts-qq" target="_blank">http://hackage.haskell.org/package/haskell-src-exts-qq</a><br>
&gt; <a href="http://hackage.haskell.org/package/haskell-src-meta" target="_blank">http://hackage.haskell.org/package/haskell-src-meta</a><br>
&gt;<br>
&gt; The might help you pull something together.<br>
&gt;<br>
&gt;<br>
&gt; Antoine<br>
&gt;<br>
&gt;&gt; Sam<br>
<br>
</div></div>I use haskell-src-meta in language-c-quote (also on hackage) to support<br>
antiquotation and heartily endorse it. I have not used haskell-src-exts-qq.<br>
<br>
Geoff<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</div></div></blockquote></div><br></div>