<div class="gmail_quote">On Mon, Mar 16, 2009 at 2:47 PM, Duncan Coutts <span dir="ltr"><<a href="mailto:duncan.coutts@worc.ox.ac.uk">duncan.coutts@worc.ox.ac.uk</a>></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>
> > This sounds like a chicken and egg problem. To know which package<br>
> > include directories to use GHCi needs to know which packages your module<br>
> > uses. However to work out which packages it needs it has to load the<br>
> > module which means pre-processing it!<br>
> ><br>
> > With cabal we get round this problem because Cabal calls ghc with<br>
> > -package this -package that etc and so when ghc cpp's the module it does<br>
> > know which package include directories to look in.<br>
><br>
> Perhaps I'm missing something, but if applicative-numbers is an exposed<br>
> package, shouldn't we be adding its include-dirs when invoking CPP?<br>
<br>
</div>Yes, if we know we're using it. If we specify -package blah on the<br>
command line then we do know we're using it and everything works<br>
(because ghc uses the include-dirs when it calls cpp). If we don'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'd files, as I described earlier. - Conal<br></div></div><br>