ghci module load path

Simon Marlow simonmarhaskell at
Mon Apr 30 05:38:14 EDT 2007

Joel Reymont wrote:
> Folks,
> Suppose I have a cabalized project where the source is under src/ and 
> the generated code goes into dist/build/test/test-tmp/.
> How can I load modules from the generated code directory when I'm in the 
> parent of both src and dist?
> If I do :set -idist/build/test/test-tmp then ghci tries to look for 
> source files there but they are in src. If I :set -isrc then ghci 
> doesn't look for the already compiled code and just interprets the 
> source files. I'm looking to load the pre-compiled files.

Take a look at how Cabal invokes GHC, by running 'setup build -v'.

The main options you need are -odir and -hidir, which tell GHC to look for 
object files and interface files somewhere other than next to the source files.


More information about the Glasgow-haskell-users mailing list