The version of GHC used in these instructions is GHC 8.6.5. You will need to install GHC on your machine to compile Haskell code, and VSCode, the editor we will use in the labs.
There is an OS-specific section to install GHC and VSCode for each each operating system:
Windows 10
These instructions have been tested on Windows 10.
If you have previously installed an old version of the Haskell Platform, uninstall it before proceeding with these instructions.
Uninstall instructions (only if you have previously installed Haskell)
- Open the “Add or Remove Programs” by searching in the start menu.
- Find “Haskell Platform 8.x.x” and “Haskell Stack” and click uninstall on both.
- Go to the Start menu and type
%APPDATA%. - Click on the first option, and delete the “Cabal” folder using the file browser.
Chocolatey
Chocolatey is a package manager for Windows. We will use it to install GHC and VSCode.
- Visit https://chocolatey.org/install and follow the
instructions. You will need to open the Windows Powershell
application as administrator; right-click on the icon in the start
menu to do this.

- Run
chocoto check that chocolatey is working.

- Run
choco install -y msys2to install some other tools needed to build certain haskell libraries. - Open an MSYS terminal by running
C:\tools\msys64\msys2.exeand then runpacman -Syuuwithin that window. Close the MSYS window when it finishes.


- Run
choco install -y ghc --version 8.6.5to install GHC.
- Run
choco install -y vscodeto install the VSCode editor. - Close the powershell window.
GHC Setup
- Open a Command Prompt by typing
cmd.exein the start menu. - Run
cabal v2-update. This will update the list of haskell packages your system knows about. - Run
cabal v2-install --install-method=copy ghcid. This installs ghcid — a tool that automatically reloads code when you save, making it easier to detect and fix errors. - Run
cabal v2-install --install-method=copy doctest
VSCode Setup
- Launch VSCode.
- Install Haskell support. Select “File > Preferences > Extensions”,
search for
haskelland install the “Haskell Syntax Highlighting” and “haskell-ghcid” extensions by clicking the greenInstallbuttons.

- In the bottom left, click on the cog icon, then click
“Settings”. Change the autosave setting from “off” to “afterDelay”
using the dropdown box.


MacOS
These instructions have been tested on Mojave 10.14.6 and Catalina 10.15.3.
If you have previously installed the Haskell Platform on your Mac, uninstall it before proceeding with these instructions.
Uninstall instructions (only if you have previously installed Haskell)
- Open a Terminal.
- Run
sudo uninstall-hs all --remove, followed by entering your computer’s account password. - Run
rm -rf $HOME/.cabal. - Run
rm -rf ~/.ghcup/*.
GHC
- Install the command-line developer tools from a terminal by typing
xcode-select --install, and then click agree. This may take a few minutes.


- Run the
ghcupinstaller from a terminal by typingcurl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh. You will need to press enter a couple times when prompted. This may take a few minutes. It may ask if you want to update your shell configuration — typeYESand then press enter.

- Run
ghcup install 8.6.5and thenghcup set 8.6.5 - Close the terminal and open a new one. Check that GHC is properly
installed by running
ghc --versionand checking that it saysThe Glorious Glasgow Haskell Compilation System, version 8.6.5.

VSCode
- Go to https://code.visualstudio.com/download and select the Mac option.
- Double click the archive to extract the VSCode application.
- Drag the VSCode application into your Applications folder.
- Go to your Applications folder, and run VSCode by right clicking and
selecting
Open. You should only need to do this the first time - in future you can open it using the regular Application menu.

GHC Setup
- Open a Terminal.
- Run
cabal v2-update. This will update the list of haskell packages your system knows about.

- Run
cabal v2-install ghcid. This installs ghcid — a tool that automatically reloads code when you save, making it easier to detect and fix errors.
VSCode Setup
- Launch VSCode.
- Install Haskell support. Select “Code > Preferences > Extensions”
menu, search for
haskelland install the “Haskell Syntax Highlighting” and “haskell-ghcid”` extensions by clicking the green “Install” buttons.
- In the bottom left, click on the cog icon, then click
Settings. Then change the autosave setting from “off” to
“afterDelay” using the dropdown box.


Linux Ubuntu
If you have previously installed the Haskell Platform on your computer, uninstall it before proceeding with these instructions.
Uninstall instructions (only if you have previously installed Haskell)
- Open a Terminal.
- Run
sudo apt-get remove --purge ghc-8.4.4 cabal-install happy. - Run
rm -rf ~/.ghc ~/.cabal. - Close the Terminal.
GHC
We will install ghcup, which lets us select and install specific GHC versions, and then install some tools which we will need in the course.
- Open a Terminal
- Install
ghcupdependencies. Runsudo apt-get install -y build-essential curl git libgmp-dev libffi-dev libncurses-dev libtinfo5 zlib1g-dev

- Run the
ghcupinstaller from a terminal by runningcurl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh. You will need to press enter a couple times when prompted. This may take a few minutes. It may ask if you want to update your shell configuration — typeYESand then press enter.

- Run
ghcup install 8.6.5and thenghcup set 8.6.5 - Close the terminal and open a new one. Check that GHC is properly
installed by running
ghc --versionand checking that it saysThe Glorious Glasgow Haskell Compilation System, version 8.6.5.

VSCode
- Go to https://code.visualstudio.com/download and select the appropriate linux option.
GHC Setup
- Open a Terminal.
- Run
cabal v2-update. This will update the list of haskell packages your system knows about. - Run
cabal v2-install ghcid. This installs ghcid — a tool that automatically reloads code when you save, making it easier to detect and fix errors.
VSCode Setup
- Launch VSCode.
- Install Haskell support. Select “File > Preferences > Extensions”,
search for
haskelland install the “Haskell Syntax Highlighting” and “haskell-ghcid” extensions by clicking the green “Install” buttons.

- In the bottom left, click on the cog icon, then click Settings. Then change
the autosave setting from “off” to “afterDelay” using the dropdown
box.


