Skip to content
AgileLogics
4 min read

Installing Haskell

The recommended way to install Haskell on every platform is GHCup, the official installer. It installs and manages:

  • GHC — the compiler and the ghci interpreter
  • cabal — the build tool and package manager
  • Stack — an alternative build tool (optional)
  • HLS — the Haskell Language Server, for editor support

Windows

Open PowerShell (not as administrator) and run the command shown on www.haskell.org/ghcup. It downloads GHCup, installs an MSYS2 environment for C libraries, and asks which tools to install — accept the recommended versions.

macOS and Linux

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh

On Linux, install your distribution's build essentials first (for example sudo apt install build-essential curl libffi-dev libgmp-dev libncurses-dev on Debian/Ubuntu).

Check it works

Open a new terminal so the updated PATH is picked up:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.14.1
$ cabal --version
cabal-install version 3.16.1.0
compiled using version 3.16.1.0 of the Cabal library (in-tree)

Your version numbers may differ — GHCup installs its current "recommended" versions, which usually lag slightly behind the newest release. Anything from GHC 9.4 onwards works for this course.

Managing versions

ghcup list              # show installed and available versions
ghcup install ghc 9.14.1
ghcup set ghc 9.14.1    # make it the default
ghcup tui               # interactive text menu

Try it without installing

The play.haskell.org playground compiles and runs small programs in your browser — handy for trying the examples in this course.