| Could module import splicing be added into Template Haskell? Other than | updating the syntax and pretty printer in Language.Haskell.TH, what else | would need to be done? So you want to be able to say $(f 4) and have that expand to import X or import Y or whatever? That seems convenient, and it's not very hard to implement. Import statements have to become regular declarations, able to appear anywhere; we need TH syntax for them; and so on. It came up a while ago, and Lemmih was quite keen to do it. But I've held off doing it because it'll break ghc -M and ghc --make. It'll mean that GHC can't figure out dependencies until it's actually compiling. This is an issue even for crude Cpp-ery, but we run CPP before ghc -M and ghc --make. That's not possible for TH because you have to typecheck the module before running the splices. One could say that the programmer has to write his own dependencies in the makefile, but that still doesn't help with ghc --make. I don't see an easy path. Anyway that's why it's remained un-done. Simon | -----Original Message----- | From: template-haskell-bounces@haskell.org [mailto:template-haskell-bounces@haskell.org] On | Behalf Of Simon Foster | Sent: 03 February 2006 20:45 | To: template-haskell@haskell.org | Subject: [Template-haskell] Splice Imports | | Hi, | | Could module import splicing be added into Template Haskell? Other than | updating the syntax and pretty printer in Language.Haskell.TH, what else | would need to be done? | | Thanks, | | -Simon Foster. | | _______________________________________________ | template-haskell mailing list | template-haskell@haskell.org | http://www.haskell.org/mailman/listinfo/template-haskell
participants (1)
-
Simon Peyton-Jones