RE: [Template-haskell] Splicing bindings
Sadly no. Ideally one would like to be able to splice in *any* syntactic construct, but at present implementing each requires separate work in the implementation, and it's especially tricky if the construct can bind things (such as declarations, patterns, and do-statements). Again, you can do it "by steam" using the lower-level constructors... it's just more clumsy. Simon | -----Original Message----- | From: template-haskell-bounces@haskell.org [mailto:template-haskell-bounces@haskell.org] On | Behalf Of Mike Gunter | Sent: 13 June 2005 06:24 | To: template-haskell@haskell.org | Subject: [Template-haskell] Splicing bindings | | | Is there a way to splice in a | | nm <- m | | binding? I.e., I'd like something along the lines of | mdo | ... | $(defNm nm m) | ... | ... nm ... | ... | | which would expand to | | mdo | ... | nm <- name "nm" m | ... | ... nm ... | ... | | . Is this possible? | | thanks, | mike | _______________________________________________ | template-haskell mailing list | template-haskell@haskell.org | http://www.haskell.org/mailman/listinfo/template-haskell
participants (1)
-
Simon Peyton-Jones