Skip to content

Instantly share code, notes, and snippets.

@fscm
Last active April 21, 2020 09:36
Show Gist options
  • Save fscm/32a1cafa44a3027aefeedbae26923442 to your computer and use it in GitHub Desktop.
Save fscm/32a1cafa44a3027aefeedbae26923442 to your computer and use it in GitHub Desktop.
[macOS] Install Haskell Platform

[macOS] Install Haskell Platform

Instructions on how to install the Haskell Platform on macOS.

Uninstall

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

Prerequisites

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

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 /

Configure

Add the following lines to the .bash_profile file:

# add python tools to path
export PATH="${PATH}:${HOME}/Library/Haskell/bin"

Verify

Open a new terminal window and check if the Python 3 programming language is installed:

ghc --version
cabal --version

Clean up

After installing the Haskell Platform you can remove the downloaded installation package using the following command:

rm -rf ~/Downloads/Haskell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment