Windows:将Haskell-Source-Code加载到ghci中

时间:2022-07-20 16:07:33

I am a newbie to Haskell and my problem is probably very trivial, yet I do not know how to solve it.

我是Haskell的新手,我的问题可能非常简单,但我不知道如何解决它。

I created a minimal source code (for faculty, as in the tutorial) with the Editor in Windows 7, then saved it as "test.hs" . Now if I try to load the file into the Haskell interpreter (ghci), then it will give me the following error message:

我在Windows 7中使用编辑器创建了一个最小的源代码(对于教师而言,如教程中),然后将其保存为“test.hs”。现在,如果我尝试将文件加载到Haskell解释器(ghci)中,那么它将给出以下错误消息:

: can't find file S:\Haskell-Code\test.hs Failed. modules loaded: none.

:找不到文件S:\ Haskell-Code \ test.hs失败。加载的模块:无。

I am sure that I am in the right directory, I also tried loading test (which gives me another error message telling me that it isn't a module), also renamed the file to just "test". Is there something I am missing?

我确信我在正确的目录中,我也尝试加载测试(这给我另一个错误消息,告诉我它不是一个模块),也将文件重命名为“test”。有什么我想念的吗?

Thanks in advance.

提前致谢。

1 个解决方案

#1


Can you start ghci (in the right directory) and then type

你可以启动ghci(在正确的目录中),然后键入

:!dir

  • Does it display the right directory?
  • 它显示正确的目录吗?

  • Do you see the file test.hs?
  • 你看到文件test.hs了吗?

#1


Can you start ghci (in the right directory) and then type

你可以启动ghci(在正确的目录中),然后键入

:!dir

  • Does it display the right directory?
  • 它显示正确的目录吗?

  • Do you see the file test.hs?
  • 你看到文件test.hs了吗?