[GHC] #11377: Template Haskell only imports

#11377: Template Haskell only imports -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: feature | Status: new request | Priority: low | Milestone: Component: Template | Version: 7.11 Haskell | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This is the Template Haskell equivalent of #11244. It should be possible to use the plugin package database to make a Template Haskell only import; I suggest the syntax `import {-# TH_ONLY #-} Foo`. Such imports are only allowed to be used in splices, and cannot be quoted (they are not allowed to reside in the final code generated by the splice.) The reason a user may want to use such an import is that it means that they can declare that a library is necessary when compiling splices, but not necessary when actually linking against it. There are extra benefits. If a user is compiling the package with the splices with profiling, it ordinarily requires all imports to have been compiled with profiling. This would NOT be necessary for a `TH_ONLY` import, since we're only ever going to run the imported code in the (non- profiled) compiler, and not in the (profiled) executable.) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11377 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11377: Template Haskell only imports -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Template Haskell | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by shlevy): With the ultimate goal of supporting TH in cross-compilation, I've got a WIP branch to separate out compile time and runtime code more rigorously at https://github.com/shlevy/ghc/tree/lifecycle-staging (current WIP commit is on separating out the HPT). This work is temporarily on hold while I get a quick fix working using external-interpreter running on the target, but I hope to get back to it soon as it's clearly the better long- term solution and works for plugins too. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11377#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC