Instructions on how to install the Haskell Platform on macOS.
First step should be to unsinstall any previous Haskel installation. This step can be skipped if no Haskell Platform was previously installed.
This will completelly remove any Haskell Platform previously installed. If you which to keep the libraries installed with
cabal
you should skip the last command.
To uninstall any previous Haskell installations use the following commands:
sudo find /usr/local/bin /usr/local/share \( -lname '*/Library/Haskell/*' -o -lname '*/Library/Frameworks/GHC.framework/*' \) -delete
sudo rm -rf /Library/Haskell
sudo rm -rf /Library/Frameworks/GHC.framework
sudo rm -rf ${HOME}/Library/Haskell
macOS Command Line Tools need to be installed on your local computer.
To install the Command Line Tools run the following command:
xcode-select --install
The Haskell Platform can be obtained here. Copy the link for the package version that you want to install from there.
Get the Haskell Platform installer package using the following commands:
mkdir ~/Downloads/Haskell
(cd ~/Downloads/Haskell && curl --silent --location --retry 3 --remote-name "https://downloads.haskell.org/~platform/8.6.3/Haskell%20Platform%208.6.3%20Core%2064bit-signed.pkg")
Run the installer package using the following command:
sudo installer -pkg ~/Downloads/Haskell/Haskell*.pkg -target /
Add the following lines to the .bash_profile
file:
# add python tools to path
export PATH="${PATH}:${HOME}/Library/Haskell/bin"
Open a new terminal window and check if the Python 3 programming language is installed:
ghc --version
cabal --version
After installing the Haskell Platform you can remove the downloaded installation package using the following command:
rm -rf ~/Downloads/Haskell