0

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.

2
  • 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. Commented May 2, 2015 at 10:04
  • I also supposed that it should work, however, it doesn't. Commented May 2, 2015 at 10:29

1 Answer 1

0

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?
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks!Yes, It does find the file, however it is text.hs.txt That's probably the problem. Is there a way to get the ".txt"-ending away (it is not in the filename itself)?
@Yinyue: Do you start ghci in cmd or Powershell? In this case you can use move test.hs.txt test.hs. However, you can also simply show file extensions and edit the file in explorer. The setting can be found in the view menu.
as a fast hack you can type :!move test.hs.txt test.hs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.