Its a much simpler thing, but I would like to see a template haskell library and quasi-quoter that used a monad transformer instead of just Q.<br><br><div class="gmail_quote">On Thu, May 24, 2012 at 1:47 AM, Simon Peyton-Jones <span dir="ltr">&lt;<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Maybe take a look at<br>
   <a href="http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal" target="_blank">http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal</a><br>
<div class="HOEnZb"><div class="h5"><br>
| -----Original Message-----<br>
| From: <a href="mailto:haskell-cafe-bounces@haskell.org">haskell-cafe-bounces@haskell.org</a> [mailto:<a href="mailto:haskell-cafe-">haskell-cafe-</a><br>
| <a href="mailto:bounces@haskell.org">bounces@haskell.org</a>] On Behalf Of Tillmann Rendel<br>
| Sent: 23 May 2012 18:20<br>
| To: Haskell Café<br>
| Subject: Re: [Haskell-cafe] Typed TemplateHaskell?<br>
|<br>
| Hi Ilya,<br>
|<br>
| Ilya Portnov wrote:<br>
| &gt; As far as can I see, using features of last GHC one could write typed<br>
| &gt; TH library relatively easily, and saving backwards compatibility.<br>
| &gt;<br>
| &gt; For example, now we have Q monad and Exp type in &quot;template-haskell&quot;<br>
| &gt; package. Let&#39;s imagine some new package, say &quot;typed-template-haskell&quot;,<br>
| &gt; with new TQ monad and new polymorphic type Exp :: * -&gt; *. Using last<br>
| &gt; GHC&#39;s features, one will easily write something like &quot;expr :: Exp<br>
| &gt; String&quot;, which will mean that &quot;expr&quot; represents a string expression.<br>
| &gt; And we will need a new function, say runTQ :: TQ a -&gt; Q a (or some<br>
| &gt; more complicated type), which will turn TypedTemplateHaskell&#39;s<br>
| &gt; constructs into plain TH.<br>
|<br>
| That would be a good thing to have. But it might be quite hard to<br>
| implement. For example, I guess you might want to have functions like<br>
| this one:<br>
|<br>
|    apply :: Exp (a -&gt; b) -&gt; Exp a -&gt; Exp b<br>
|<br>
| This function takes two typed expressions and produces an application.<br>
| The types ensure that the generated application will typecheck. Cool.<br>
|<br>
| But can you do the same thing for lambdas? Lambdas create functions, so<br>
| the type would be something like the following:<br>
|<br>
|    lambda :: ... -&gt; Exp (a -&gt; b)<br>
|<br>
| But what would you put instead of the ...?<br>
|<br>
| I fear that overall, you would have to reimplement Haskell&#39;s type system<br>
| in Haskell&#39;s type system. Which sounds like a cool thing to do, but<br>
| maybe not so easily.<br>
|<br>
|    Tillmann<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>
<br>
<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>