LinuxCommandLibrary

ghcup

Manage Haskell toolchain installations (GHC, Cabal)

TLDR

Start the interactive TUI

$ ghcup tui
copy

List available GHC/cabal versions
$ ghcup list
copy

Install the recommended GHC version
$ ghcup install ghc
copy

Install a specific GHC version
$ ghcup install ghc [version]
copy

Set the currently "active" GHC version
$ ghcup set ghc [version]
copy

Install cabal-install
$ ghcup install cabal
copy

Update ghcup itself
$ ghcup upgrade
copy

SYNOPSIS

ghcup command [--options]

PARAMETERS

install
    Install a tool, such as ghc, cabal, or stack.

upgrade
    Upgrade installed tools to the latest versions.

set
    Set the default version of a tool.

list
    List installed tools and available versions.

uninstall
    Uninstall a tool.

config
    Manage ghcup configuration settings.

help
    Display help information.

--no-stack-add
    Do not add stack installations to PATH.

--no-cabal-add
    Do not add cabal installations to PATH.

--no-ghc-add
    Do not add ghc installations to PATH.

DESCRIPTION

ghcup is the recommended installer for the Glasgow Haskell Compiler (GHC), Haskell Language Server (HLS) and associated tools on Unix-like systems.
It automates the process of downloading, installing, and managing multiple GHC versions, cabal, stack, and other essential Haskell development components.
It helps create isolated environments to test different GHC versions, which is crucial for maintaining compatibility and reproducibility in Haskell projects.
ghcup simplifies project setup and dependency management.
It provides a command-line interface for installing, uninstalling, and switching between different tool versions.
It is often used by developers to easily manage their Haskell toolchain and ensure consistency across different projects.

CAVEATS

ghcup requires an internet connection to download tools.
Incorrect configuration of the PATH environment variable can lead to issues with tool execution.
Conflicts may arise if other Haskell tools are installed system-wide.

ENVIRONMENT VARIABLES

ghcup uses environment variables such as PATH to manage tool locations.
It is important to ensure that the ghcup directories are correctly included in your PATH.

CONFIGURATION FILE

The ghcup configuration is stored in ~/.ghcup/config.
This file can be manually edited to customize installation directories and other settings.

HISTORY

ghcup was created to provide a simpler and more reliable way to install and manage GHC and associated tools compared to previous methods.
It addresses the challenges of installing multiple GHC versions and managing dependencies.
The project has evolved with continuous improvements and updates to support new tools and features within the Haskell ecosystem.

SEE ALSO

cabal(1), stack(1), ghc(1)

Copied to clipboard