找到你要的答案

Q:Windows: Loading Haskell-Source-Code into ghci

Q:窗户:Haskell源代码加载到ghci

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

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:

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

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?

Thanks in advance.

我是一个新手教程,和我的问题可能很琐碎,但我不知道如何解决它。

我在Windows 7编辑器中创建了一个最小的源代码(对于教员来说,在教程中),然后保存为“测试”。现在如果我尝试加载文件到Haskell解释器(ghci),然后它会给我下面的错误信息:

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

我确信我在正确的目录,我也尝试加载测试(这给了我另一个错误信息告诉我,它不是一个模块),也改名文件只是“测试”。有什么东西我不见了吗?

先谢谢了。

answer1: 回答1:

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

:!dir

  • Does it display the right directory?
  • Do you see the file test.hs?

你能开始ghci(在正确的目录),然后键入

:!目录

  • Does it display the right directory?
  • Do you see the file test.hs?
haskell  loading  interpreter  ghci