ghci finding include files exported from other packages?

Simon Marlow marlowsd at gmail.com
Mon Mar 16 08:13:07 EDT 2009


Duncan Coutts wrote:
> On Sat, 2009-03-14 at 23:43 -0700, Conal Elliott wrote:
>> The applicative-numbers package [1] provides an include file.  With
>> ghci, the include file isn't being found, though with cabal+ghc it is
>> found.
>>
>> My test source is just two lines:
>>
>> {-# LANGUAGE CPP #-}
>> #include "ApplicativeNumeric-inc.hs"
>>
>> I'd sure appreciate it if someone could take a look at the .cabal file
>> [2] and tell me if I'm doing something wrong.  And/or point me to one
>> or more working examples of cabal packages that export include files
>> that are then findable via ghci.
> 
> This sounds like a chicken and egg problem. To know which package
> include directories to use GHCi needs to know which packages your module
> uses. However to work out which packages it needs it has to load the
> module which means pre-processing it!
> 
> With cabal we get round this problem because Cabal calls ghc with
> -package this -package that etc and so when ghc cpp's the module it does
> know which package include directories to look in.

Perhaps I'm missing something, but if applicative-numbers is an exposed 
package, shouldn't we be adding its include-dirs when invoking CPP?

Cheers,
	Simon



More information about the Glasgow-haskell-users mailing list