<div dir="ltr">It&#39;s true that it won&#39;t be a runtime hit at all, so the parsing complexity isn&#39;t a concern from that perspective. I *am* worried about making Hamlet too complicated however. Does anyone else out there have an opinion on this topic?<div>
<br></div><div>Actually, using the new period-not-required syntax, your example could be rewritten:</div><div><br></div><div>[$hamlet|^(template f) x^|]</div><div><br></div><div>which is definitely easier on my eyes. However, that syntax would not be available in $forall, $maybe et al.</div>
<div><br></div><div>Michael</div><div><br></div><div>PS: I like your e-mail address.<br><br><div class="gmail_quote">On Thu, Jul 22, 2010 at 1:49 PM, Mark Bradley <span dir="ltr">&lt;<a href="mailto:barkmadley@gmail.com">barkmadley@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">looking at the code it does appear that your grammar for ContentEmbed<br>
objects could be extended to include lparen and rparen&#39;s.  I&#39;m not<br>
sure exactly how this would translate with the deref function in<br>
Text.Hamlet.Quasi (i havent used template haskell before) but it looks<br>
like it is entirely possible, meaning my example would become:<br>
<div class="im"><br>
fun f x = [$hamlet| ^(template.f).x^ |]<br>
<br>
</div>and all is well.  you could add an encoding for this such as:<br>
<br>
template.f,x<br>
<br>
this would have the same effect as the $ function from regular haskell.<br>
<br>
the problem with that encoding is that is it less general than just<br>
allowing parens and probably more error prone.<br>
<br>
the good thing about this is that it doesn&#39;t really matter how<br>
complicated you make the encoding and parsing and haskell code<br>
generation because it happens once at compile time.<br>
<div><div></div><div class="h5"><br>
On Wed, Jul 21, 2010 at 2:41 PM, Michael Snoyman &lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Jul 21, 2010 at 4:17 AM, Mark Bradley &lt;<a href="mailto:barkmadley@gmail.com">barkmadley@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; hamlet doesn&#39;t appear to support functions that take more than one<br>
&gt;&gt; argument.<br>
&gt;&gt;<br>
&gt;&gt; i.e.<br>
&gt;&gt;<br>
&gt;&gt; fun f x = [$hamlet| ^template.f.x^ |]<br>
&gt;&gt;<br>
&gt;&gt; produces the call template (f x)<br>
&gt;&gt;<br>
&gt;&gt; is there some way to make hamlet produce (template f) x?<br>
&gt;<br>
&gt; Unfortunately not. It&#39;s not any *technical* limitation in Hamlet, just that<br>
&gt; I can&#39;t think of a good, intuitive syntax for it. The way that I work around<br>
&gt; this is by defining variables in a where clause, eg<br>
&gt; fun f x = [$hamlet|^templateTmp^|] where templateTmp = template f x<br>
&gt; If you have better ideas, I&#39;m open to hearing them ;).<br>
&gt; Michael<br>
</div></div></blockquote></div><br></div></div>