Haskell module not found. What is wrong with my project's file structure?
I have a problem with my project structure:
pic-analysis-0.1/AlgTop/Data.hs
Functions.hs
PNGModify.hs
Main.hs
Data.hs
:
module AlgTop.Data (…) where
Functions.hs
:
module AlgTop.Functions (…) where
import AlgTop.Data
The AlgTop.Functions
module doesn't find AlgTop.Data
.
I compared my project structure approach with that of ansi-terminal
on Hackage (see below), but I couldn't spot any difference. What am I doing wrong?
ansi-terminal-xxx/System/Console/ANSI/Common.hs
/Unix.hs
/…
Common.hs
:
mod开发者_如何学Cule System.Console.ANSI.Common where
Unix.hs
:
module System.Console.ANSI.Unix (…) where
import System.Console.ANSI.Common
Error message:
[...]
*** Chasing dependencies:
Chasing modules from: *Functions.hs
Functions.hs:9:8:
Could not find module `AlgTop.Data':
locations searched:
AlgTop/Data.hs
AlgTop/Data.lhs
[...]
If you are using ghci it is probably that you need to :set -i/.../pic-analysis-0.1
. That is, include the root directory of your module hierarchy.
No need to set anything. Just cd into the root directory before invoking GHCi:
ghci AlgTop/Functions.hs
精彩评论