[Template-haskell] Avoiding linking final executable to TH

Simon Peyton-Jones simonpj at microsoft.com
Mon Jul 11 07:46:41 EDT 2005


Einar raises another TH-linking question: how to avoid linking the TH
libraries (which are needed at compile time) into the runtime
executable.

The difficulty is that GHC doesn't know for sure that you aren't going
to need the libraries at runtime too.

If you do a batch link step
	ghc -o foo This.o That.o Main.o -package mylib
does that work ok?  Is the problem only with --make?

I'm reluctant to have two kinds of imports. Other ideas welcome.  Better
still, someone willing to take up the cudgels.  Again, once the
specification is clear, we can offer guidance.

Simon

| -----Original Message-----
| From: template-haskell-bounces at haskell.org
[mailto:template-haskell-bounces at haskell.org] On
| Behalf Of Einar Karttunen
| Sent: 04 July 2005 09:48
| To: template-haskell at haskell.org
| Subject: [Template-haskell] Avoiding linking final executable to TH
| 
| Hello
| 
| Are there currently any plans to avoid linking the final executable
with
| TH? As far as I understand currently the situation is as follows:
| 
| Module M uses TH code defined in MTH.
| Module MTH imports TH modules and thus needs to be linked with
template-haskell.
| 
| The simplest way to deal with this could be to use a special
| compile-time import construct between M and MTH - so that MTH would
| not need to be linked with M (and thus template-haskell would not be
| needed either).
| 
| Are there any plans regarding something like this or an another
solution?
| 
| - Einar Karttunen
| _______________________________________________
| template-haskell mailing list
| template-haskell at haskell.org
| http://www.haskell.org/mailman/listinfo/template-haskell


More information about the template-haskell mailing list