0
votes

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.

1
The file should definitely be called "*.hs". Provided you are in the directory, where the file lives (i.e. you started ghci there), :load test.hs should work. In that case ghci should not complain with a full path even if you get the filename wrong. - Martin Drautzburg
I also supposed that it should work, however, it doesn't. - Yinyue

1 Answers

0
votes

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?