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"><<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>></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>
| > As far as can I see, using features of last GHC one could write typed<br>
| > TH library relatively easily, and saving backwards compatibility.<br>
| ><br>
| > For example, now we have Q monad and Exp type in "template-haskell"<br>
| > package. Let's imagine some new package, say "typed-template-haskell",<br>
| > with new TQ monad and new polymorphic type Exp :: * -> *. Using last<br>
| > GHC's features, one will easily write something like "expr :: Exp<br>
| > String", which will mean that "expr" represents a string expression.<br>
| > And we will need a new function, say runTQ :: TQ a -> Q a (or some<br>
| > more complicated type), which will turn TypedTemplateHaskell's<br>
| > 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 -> b) -> Exp a -> 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 :: ... -> Exp (a -> b)<br>
|<br>
| But what would you put instead of the ...?<br>
|<br>
| I fear that overall, you would have to reimplement Haskell's type system<br>
| in Haskell'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>