Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change path of ghc?

I'm using HaskellPlatform-2012.4.0.0 on Win7. It's installed as portable. Paths are managed through .bat file so ghci and ghc works. Cabal config and folder are made semi-portable with this.

The problem is ghc folder. It installs itself in C:\Users\name\AppData\Roaming\ghc\i386-mingw32-7.4.1.

How to change it's default path? So I can have really portable Haskell on windows :)

EDIT: There are 3 new system variables that do nothing. Here are results:

SET APPDATA=%~dp0AppData   -- has no effect. ghc is still made in roaming
SET USERPROFILE=%~dp0  -- kills cabal
SET LOCALAPPDATA=%~dp0Local   --not sure if this is ever used.

kills cabal error link

like image 828
CoR Avatar asked Feb 14 '13 02:02

CoR


People also ask

How do I change directory in Haskell?

Then start up Haskell, use the :cd command to change to your home directory or subdirectory, then the :load command to load the file. Try things out. If you want to edit your file, do so and save it, and then back in Haskell reload the file using :reload.

How do I open a GHC file?

If you have installed the Haskell Platform, open a terminal and type ghci (the name of the executable of the GHC interpreter) at the command prompt. Alternatively, if you are on Windows, you may choose WinGHCi in the Start menu. And you are presented with a prompt. The Haskell system now attentively awaits your input.

How do I check my GHC?

The version number of your copy of GHC can be found by invoking ghc with the --version flag (see Verbosity options). The compiler version can be tested within compiled code with the MIN_VERSION_GLASGOW_HASKELL CPP macro (defined only when CPP is used).

How do I install GHC in Haskell?

Run the command "$ sudo apt-get install haskell-platform" and press Enter. It will automatically start downloading Haskell on your system after authenticating you with the root password. After installing, you will receive a confirmation message. Step 4 − Go to your terminal again and run the GHCI command.


1 Answers

You could try SET USERPROFILE=%~dp0 while making sure that the folder structure supports what Cabal expects. It is probably attempting to go to %USERPROFILE%AppData\Roaming or something similar.

like image 132
Guvante Avatar answered Sep 28 '22 17:09

Guvante