3

我的项目结构有问题:

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

AlgTop.Functions模块未找到AlgTop.Data.

我将我的项目结构方法与ansi-terminalHackage 上的方法进行了比较(见下文),但我没有发现任何区别。我究竟做错了什么?

ansi-terminal-xxx/System/Console/ANSI/Common.hs
                                     /Unix.hs
                                     /…

Common.hs

module System.Console.ANSI.Common where

Unix.hs

module System.Console.ANSI.Unix (…) where
import System.Console.ANSI.Common

错误信息:

[...]
*** 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
[...]
4

2 回答 2

4

如果您使用的是 ghci,则可能需要:set -i/.../pic-analysis-0.1. 也就是说,包括模块层次结构的根目录。

于 2011-09-12T11:24:31.467 回答
4

无需设置任何东西。在调用 GHCi 之前,只需 cd 进入根目录:

ghci AlgTop/Functions.hs
于 2011-09-13T08:50:36.760 回答