Reputation: 366
I recently downloaded the Haskell Platform from the Haskell website. Under the suggestion of the newer answers in this, I blindly ran brew install ghc cabal-install
and cabal install cabal cabal-install
. Did I install two versions of Haskell on my machine? What should I do to fix any problems?
Upvotes: 2
Views: 2115
Reputation: 2361
It doesn't necessarily lead to problems to have multiple versions (I think I have three different versions installed). If you need the disk space uninstall one of the two (instructions for the brew one, for the packaged platform it seems you should be able to use the command sudo uninstall-hs
but check it yourself first). If you don't mind the lost disk space, you only have to make sure you have your PATH
set up correctly, with the directory containing the ghc binary you want to use in your PATH
, before the directory of the other one.
Also, cabal install cabal-install
(which you might need to run to update cabal) tends to install cabal in a different place than the platform/brew do, so there, again, you need to make sure your PATH
is appropriately set. Normally cabal installs executables in ~/.cabal/bin
(local installs) or /usr/local/bin
(global installs). The directory containing cabal
should go before the others, because an old version of cabal
might stick around and you want the new one to be found first.
You probably know this but you can use which ghc
and which cabal
to check the location of the executable actually being used.
To make things even more complicated, lately it's popular to use Stack, which can also install ghc for you (I find this very convenient, everything is kept in a very controlled environment). So depending on your experience/use case this might be worth looking at as well (but if you just want to try Haskell I recommend you stick with the platform or the brew installation).
Upvotes: 3