#1800: Template Haskell support for running functions defined in the same
module
------------------------------+---------------------------------------------
Reporter: simonpj | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: _|_
Component: Template Haskell | Version: 6.6.1
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Architecture: Unknown
Os: Unknown |
------------------------------+---------------------------------------------
Comment (by fons):
Replying to [comment:1 simonpj]:
> Here's why it's hard. It involves compiling the functions ''before''
the splice to bytecode, so that they can be run. But we don't always want
to do that!
Due to the additional overhead I presume...
> So the trickiness is simply the plumbing required to notice that f is
called from inside a splice, so we'd better compile it to bytecode early.
Oh, and the transitive closure of things called by f.
I'm not an GHC-expert at all, but, at the risk of not understanding a
single word of your answer, can I ask why would it be so difficult to
obtain the dependencies of each splice?
> A possible approximation is: see if ''anything'' defined in this module
is called from within a splice, and if so compile ''everything'' to
bytecode, just in case.
Others might not agree, but at least for me, the lack of the feature
requested in this ticket is the biggest practical limitation of Template
Haskell.
I ignore what overhead can cause the approximation proposed above, but It
would maybe be a good idea to implement it until a better solution is
found. Depending on the extend in which compilation-speed is affected, it
would even be a good idea to only provide this feature through a compiler-
flag.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1800#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs