GHCup makes it easy to install specific versions of GHC on GNU/Linux, macOS (aka Darwin), FreeBSD and Windows and can also bootstrap a fresh Haskell developer environment from scratch. It follows the unix UNIX philosophy of do one thing and do it well. Similar in scope to rustup, pyenv and jenv.
The following commands will download the
ghcup binary into
C:\ghcup\bin on windows) and then
run it to interactively install the Haskell Toolchain. These commands should be run as non-root/non-admin
For Linux, macOS, FreeBSD or Windows Subsystem 2 for Linux, run this in a terminal:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
For Windows, run this in a PowerShell session:
Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true
- To get started with creating a Haskell project, follow the Getting Started with Haskell and Cabal guide
- To properly learn Haskell, run through the CIS 194 Haskell course including exercises
- To learn more about Haskell Toolchain management, check out the ghcup user guide
On linux, just run
ghcup nuke, then make sure any ghcup added lines in your
~/.bashrc (or similar) are removed.
On windows, double-click on the
Uninstall Haskell.ps1 PowerShell script on your Desktop.
GHCup supports the following tools, which are also known as the Haskell Toolchain:
This list may not be exhaustive and specifies support for bindists only.
|Windows Server 2016||amd64||✅||✅||✅||✅||✅|
|Windows Server 2019||amd64||✅||✅||✅||✅||✅|
|Windows Server 2022||amd64||✅||✅||✅||✅||✅|
May or may not work, several issues:
Unsupported. GHC may or may not work. Upgrade to WSL2.
Not supported. Would require separate binaries, since >=13 binaries are incompatible. Please upgrade.
HLS bindists are still experimental. Stack is theoretically supported, but has no binaries yet.
Lacks some upstream bindists and may need compat libs, since most bindists are built on FreeBSD-12. HLS bindists are experimental.
Lower availability of bindists. HLS only has experimental ones. Stack not supported currently.
Download the binary for your platform at https://downloads.haskell.org/~ghcup/
and place it into your
If you want to GPG verify the binaries, import the following key first:
Then adjust your
~/.bashrc (or similar, depending on your shell) like so: