Here is my scenario:
I'm working on a project with the following directories/modules:
|--proj
|-- src
|-- Foo
|-- FooModule1.hs
|-- FooModule2.hs
|-- Bar
|-- BarModule1.hs
BarModule1.hs
looks like this:
module BarModule1 where
import Foo.FooModule1
...
I also have a .cabal
file specifying src
as the hs-source-dirs
and of course both modules are listed in it.
When I am in the file BarModule1.hs
in Emacs and I do C-c C-l it says:
proj/src/Bar/BarModule1.hs:3:8:
Could not find module `Foo.FooModule1'
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
Also I want to use hlint
with flymake-haskell-multi-load
and if I activate that mode with M-x flymake-haskell-multi-load
, hlint
will always show the error that it can't find module Foo.FooModule1
, because it is not aware of the .cabal
file, in which I specify that hs-source-dirs: src
.
So my question is: How can I make haskell-mode
and flymake
/hlint
be aware of my project directory/module tree, so that it finds all modules?
Alternatively, how can I make them aware of the modules specified in my .cabal
file?