Downloads

This page describes the installation of the Haskell toolchain, which consists of the following tools:

  • GHC: the Glasgow Haskell Compiler

  • cabal-install: the Cabal installation tool for managing Haskell software

  • stack: a cross-platform program for developing Haskell projects

  • haskell-language-server (optional): A language server for developers to integrate with their editor/IDE

Installation instructions

  1. Install GHC, cabal-install and haskell-language-server via GHCup
  2. To install stack, follow the instructions here

Alternative installation options

Using a package manager

Linux

Refer to your distribution package manager documentation. For convenience, below are a few distribution specific instructions, outlining 3rd party repository use as well.

Note: Most linux distros don’t allow different versions of GHC to be installed in parallel. Sometimes the GHC packages are a bit outdated as well. In either case, consider using GHCup instead.

Note: haskell-language-server isn’t packaged by most distributions. Instead you will have to install it manually, see the release page, unless you use VSCode, which bootstraps everything automatically. This is optional.

Show linux distros

Ubuntu

Steps to setup ghc and cabal are given in the ghc ppa

Packages from the PPA can be installed as follows:

sudo add-apt-repository -y ppa:hvr/ghc
sudo apt-get update
sudo apt-get install -y cabal-install-XXX ghc-YYY

Packages are installed into /opt/ghc/bin and /opt/cabal/bin

Steps to setup stack are on the stack website.

Debian

Steps to setup ghc and cabal are given in the ghc debian apt repository

Steps to setup stack are on the stack website.

Fedora

GHC, cabal-install and stack are in the official Fedora repos, to install:

sudo dnf install ghc cabal-install

There are also Fedora module streams with newer versions of ghc:

sudo dnf module list ghc
sudo dnf module install ghc:X.Y

The different versions cannot be parallel installed.

There are also unofficial Fedora Copr repos with more recent cabal-install.

EPEL for RHEL/CentOS/etc
  • EPEL 7 has ghc-7.6.3 and cabal-install-1.16.1.0
  • EPEL 5 and 6 have ghc-7.0.4 and cabal-install-0.10.2

To install these older versions of ghc and cabal-install from the official EPEL repo, just run the install command:

sudo yum install ghc cabal-install

For newer versions of ghc you can use the unofficial Fedora Copr repos:

Note that the different ghc package versions cannot be installed in parallel.

Arch Linux

Note: installing the Haskell toolchain via the Arch Linux package manager is not recommended, since it enforces dynamic linking, which can cause various issues. Instead consider GHCup.

The official repos on Arch Linux contain packages ghc, cabal-install, happy, alex, haddock. Install them with:

sudo pacman -S ghc cabal-install happy alex haskell-haddock-library
openSUSE Leap
  • Leap 15.1 has ghc-8.6.4 and cabal-install-2.4.0.0

To install from official openSUSE:Leap repo, just run the install command:

sudo zypper in ghc cabal-install

For last stable version you can use the development openSUSE repository:

Use this command to add repository to your system:

sudo zypper ar -f -p 90 https://download.opensuse.org/repositories/devel:/languages:/haskell/openSUSE_Leap_15.1/devel:languages:haskell.repo

openSUSE Tumbleweed
  • Tumbleweed has last stable version of ghc and cabal install.

To install from official openSUSE:Tumbleweed repo, just run the install command:

sudo zypper in ghc cabal-install

Gentoo

While the Haskell toolchain is available in the main gentoo repository, it is recommended to use the more up-to-date gentoo-haskell overlay. This can be done using layman:

sudo layman -a haskell
sudo emerge --ask dev-lang/ghc dev-haskell/cabal-install

Windows

  1. Configure Chocolatey on your machine
  2. At an elevated command prompt, run choco install haskell-dev haskell-stack, followed by refreshenv.

Official bindists

GHC bindists are binary packages built as part of the GHC release process and are guaranteed to have passed the test suite. The installation process is a bit manual, so this is meant for power users.

The GHC download page gives an extensive overview of available options. Navigate to the version you seek and click on Binary packages. You may also visit downloads.haskell.org/~ghc for the complete list. Likewise, to install cabal-install manually visit downloads.haskell.org/~cabal.

Haskell-language-server binaries can be found here.

Building from source

Building from source can be a difficult task, but may be necessary if all other installation options fail. Refer to the Haskell gitlab wiki for further instructions.

For building cabal-install from source, follow the instructions in the README.

For building haskell-language-server from source, follow the instructions here.

Other options

Other popular installation options not further described here include:

  • nix: a popular cross-distro package manager, aiming to provide reproducible builds and declarative configuration