On 19 July 2010 14:31, Jonathan Geddes <geddes.jonat...@gmail.com> wrote: > Now when I'm working in a subdirectory, say Foo where the modules are > named Foo.Bar, Foo.Baz, Foo.etc., and I try to compile Bar.hs which > imports Foo.Baz, the compiler looks for the file Foo/Baz.hs. The > problem is that I'm already in the directory Foo and so the compiler > fails to find the file for the module Foo.Baz. If I compile the whole > project from the root project directory where the main file is, the > compiler finds every module just fine.
A similar query was just asked: http://www.haskell.org/pipermail/haskell-cafe/2010-July/080523.html > It seams very strange to me that when the compiler is compiling a > module named Foo.Bar and there is an import for Foo.Baz, the compiler > doesn't look in the directory where Foo.Bar is located (the current > dir)! Run ghc[i] from the root (source) directory of your project, not within the hierarchy (note that haskell-mode for emacs tries to do this by finding where the .cabal file is, etc.). -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe