Giant1
Giant1

Reputation: 11

cant open GHCi with ghci command in command prompt

I am about to learn Haskell, (maybe, if I can get the program to work) I am working along with the book,"Learn you a Haskell for great good". I did some DOS in 80's a few weeks of COBAL in the 90's, so absolute noob.

I have loaded chocolatey into powershell in windows 10 as an administrator, that worked, entered choco install haskell-dev haskell-stack. That worked. ran refreshenv, that worked. then rebooted computer, went to command prompt and entered ghci [return] and is says no file found. then tried installing -dev and -stack with --force command, and that worked in case didnt take the first time. went to command prompt ghci nothing. reboot, command prompt then ghci [return] cant find file. ugh. any ideas?

Upvotes: 1

Views: 788

Answers (1)

Francis King
Francis King

Reputation: 1732

My Haskell notes say a fresh installation goes like this:

  • Install chocolatey as administrator. There should be no errors returned. Run 'choco' to ensure that the installation worked.
  • Install stack
  • choco install haskell-dev
  • refreshenv

On Windows, the new compiler is stored here: C:\ProgramData\chocolatey\lib\ghc\tools\ghc-8.10.1\bin. If it does not work as the default compiler, it could be masked by an earlier entry in the path list.

When you run which, PowerShell get-command what does it return? What is your path set to?

If no joy, you could search for an online Haskell REPL. Try this one: https://replit.com/languages/haskell. You can enter code on the left hand side, and run it, or start the REPL with ghci on the right hand side. It's a bit clunky by comparison to a full IDE, but perhaps enough to get started with.

Upvotes: 1

Related Questions