I'm in a ghci session trying to load a Main.hs
file I've been working on. It looks like I'm in the right directory in that I can see the file:
ghci λ> :cd /home/username/codeplace
ghci λ> :! ls
lib.hs Main.hs
But I can't seem to load it:
ghci λ> :load Main
*** Exception: code: changeWorkingDirectory: does not exist (No such file or directory)
Well that's a weird error. Same for any :l
variation I can think of:
ghci λ> :l Main
*** Exception: code: changeWorkingDirectory: does not exist (No such file or directory)
ghci λ> :l Main.hs
*** Exception: code: changeWorkingDirectory: does not exist (No such file or directory)
ghci λ> :l 'Main.hs'
target ‘'Main.hs'’ is not a module name or a source file
ghci λ> :l "Main.hs"
*** Exception: code: changeWorkingDirectory: does not exist (No such file or directory)
ghci λ> :l ./Main.hs
*** Exception: code: changeWorkingDirectory: does not exist (No such file or directory)
According to reference docs here, it should just be
:load Main
Right?
Some potential sources of weirdness that may help a haskell wizard see the error of my ways:
~/.ghc/ghci.conf
eg:
:set prompt "ghci λ> "
:set +m
:set prompt2 "ghci | "
Why can't I load, why am I getting this strange error about changing directories, and how can I fix?
Hmm, I can't provide additional information as to what was happening. Went to answer comments above after rebooting the next day and everything worked fine. Strange.