
#14298: Let Template Haskell dynamically add something with which to link -------------------------------------+------------------------------------- Reporter: harpocrates | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 8.2.1 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 hsyl20): About the API, I would prefer: {{{#!hs addForeignObject :: ByteString -> Q () }}} in order to directly produce objects from TH without having to generate temporary object files. Then it should be enough to use [https://www.stackage.org/haddock/lts-9.6 /template-haskell-2.11.1.0/Language-Haskell-TH- Syntax.html#v:addDependentFile addDependentFile] and `Data.ByteString.getContents` to write the `addForeignObjectFile :: FilePath -> Q ()` helper function. (People from Tweag I/O were also interested in this: https://www.reddit.com/r/haskell/comments/6p1aqo/building_inlinec_projects_j...) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14298#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler