<div class="gmail_quote">On Mon, Mar 16, 2009 at 2:47 PM, Duncan Coutts <span dir="ltr">&lt;<a href="mailto:duncan.coutts@worc.ox.ac.uk">duncan.coutts@worc.ox.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Mon, 2009-03-16 at 12:13 +0000, Simon Marlow wrote:<br>
<br>
&gt; &gt; This sounds like a chicken and egg problem. To know which package<br>
&gt; &gt; include directories to use GHCi needs to know which packages your module<br>
&gt; &gt; uses. However to work out which packages it needs it has to load the<br>
&gt; &gt; module which means pre-processing it!<br>
&gt; &gt;<br>
&gt; &gt; With cabal we get round this problem because Cabal calls ghc with<br>
&gt; &gt; -package this -package that etc and so when ghc cpp&#39;s the module it does<br>
&gt; &gt; know which package include directories to look in.<br>
&gt;<br>
&gt; Perhaps I&#39;m missing something, but if applicative-numbers is an exposed<br>
&gt; package, shouldn&#39;t we be adding its include-dirs when invoking CPP?<br>
<br>
</div>Yes, if we know we&#39;re using it. If we specify -package blah on the<br>
command line then we do know we&#39;re using it and everything works<br>
(because ghc uses the include-dirs when it calls cpp). If we don&#39;t<br>
specify -package then ghc does not know we need the package until after<br>
import chasing is done. Import chasing requires that we run cpp on<br>
the .hs file first and that brings us full circle.<br>
<font color="#888888"><br>
Duncan</font></blockquote><div><br>Unless you drop the cpp-first requirement and have import-chasing look into #include&#39;d files, as I described earlier.  - Conal<br></div></div><br>