Can';t在Haskell中导入.lhs脚本

Can';t在Haskell中导入.lhs脚本,haskell,Haskell,我在同一个文件夹中有两个文件,S5.hs和S6.lhs,我想在S5.hs中导入S6.lhs脚本,但当我键入导入S6时,我得到: Could not find module `S6' Use -v to see a list of the files searched for. | 1 | import S6 | ^^^^^^^^^^ Failed, no modules loaded. 当我从文件夹中启动它时,我得到以下消息(S6文件的第一行是import Data.Array): 为什么会发

我在同一个文件夹中有两个文件,
S5.hs
S6.lhs
,我想在
S5.hs
中导入
S6.lhs
脚本,但当我键入
导入S6
时,我得到:

Could not find module `S6'
Use -v to see a list of the files searched for.
|
1 | import S6
| ^^^^^^^^^^
Failed, no modules loaded.
当我从文件夹中启动它时,我得到以下消息(S6文件的第一行是import Data.Array):


为什么会发生这种情况?

看起来您需要在
S6.lhs
文件的顶部指定希望将此文件视为
S6
模块,而不是默认模块名
Main
。您可以使用
模块S6,其中
模块S6(导出,列表),其中

从同一目录启动ghc吗?你能告诉我们你是如何开始编译的吗?你确定你没有一个名为
S6.*
的文件,其中有
模块Main…
    File name does not match module name:
Saw: `Main'
Expected: `S6'
|
1 | import Data.List
| ^