[Template-haskell] QuasiQuoting for declarations

Simon Peyton-Jones simonpj at microsoft.com
Mon Dec 1 10:09:18 EST 2008


I think there is no difficulty in principle.

In the HsExpr you'll see the constructors
                HsSpliceE
                HsQuasiQuoteE
The former is run by the type checker; thelatter by the renamer.

To fulfil your hope, we'd need to add a new constructor to HsDecls.SpliceDecl.  At the moment it just has
                SpliceDecl
and we'd add
                QuasiQuoteDecl

After that I think the rest would follow. If someone feels like taking it up, I'd be glad to help.  For a start, make a Trac feature request and dump this thread into it.

Meanwhile, I gather you are using quasi-quotes.  I'm interested to know about applications: what are you using it for?

Simon

From: template-haskell-bounces at haskell.org [mailto:template-haskell-bounces at haskell.org] On Behalf Of Andrea Vezzosi
Sent: 01 December 2008 08:15
To: template-haskell at haskell.org
Subject: [Template-haskell] QuasiQuoting for declarations

Currently quasiquoting is limited to patterns and expressions, are there any problems in extending it to declarations? we already have [d| ... |] and toplevel splices afterall.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/template-haskell/attachments/20081201/080520c3/attachment.htm


More information about the template-haskell mailing list