I've started to teach myself Haskell, and for that I've installed The Haskell Platform for Windows. I'm using WinGHCi
as of now. I learned that it has command :cd
which is used to change directory. But the question is, how would I know which directory I'm currently in? Without knowing that first why would I want to change directory. I searched a lot but couldn't find the answer.
Please tell me if there is a way to know the current working directory. Preferably I would like to configure the command prompt itself to show the current directory, pretty much like Linux's Console.
Following @Daniel's suggestion, I did these:
.ghci
file (I think it is for Unix-like OS), so I created a file ghci.conf
in C:\Users\Apelles\AppData\Roaming\ghc
folder, as it is instructed here.ghci.conf
.ghci.exe
which is the console-like window. I noticed that it loaded few more modules than it usually used to load before. Here is the snapshot:As you can see it loads more modules, and the last line says,
Can't parse prompt string. Use Haskell syntax.
What does it mean? Which line is causing problem (from the following script)?
let cur fill = do { cwd <- System.Directory.getCurrentDirectory; return (":set prompt \"" ++ cwd ++ fill ++ " \""); }
:def doprompt (\_ -> cur ">")
:def mycd (\dir -> System.Directory.setCurrentDirectory dir >> cur ">")
:doprompt
Also, if I rename ghci.conf
file to some random name, and then start ghci.exe
, it loads these modules:
As I said before, it loads less number of modules, which means with ghci.conf, ghci.exe
does something successfully, but fails at some point. How to fix that?