被窝里的公息第十三章There are three widely used ways to install the Haskell toolchain on supported platforms. These are:
Minimal installers被窝里的公息第十三章: Just GHC (the compiler), and build tools (primarily Cabal and Stack) are installed globally on your system, using your system’s package manager.
Stack: Installs the
stack command globally: a project-centric build tool to automatically download and manage Haskell dependencies on a project-by-project basis.
Haskell Platform: Installs GHC, Cabal, and some other tools, along with a starter set of libraries in a global location on your system.
These options make different choices as to what is installed globally on your system and what is maintained in project-specific environments. Global installations allow more sharing across users and projects, but at the cost of potential conflicts between projects. To avoid these conflicts, each option has a lightweight sandboxing被窝里的公息第十三章 feature that creates largely self-contained, per-project environments. With Minimal you can optionally sandbox the libraries, avoiding most conflicts. Stack sandboxes the compiler, tools and libraries, so avoids nearly all kinds of conflicts between projects. With Platform you can also optionally sandbox libraries, but not the globally installed platform libraries.
In addition to the generic, cross-platform Haskell toolchain described above, there are also easy-to-use, platform-specific distributions and IDEs. The Haskell Wiki contains a .
被窝里的公息第十三章Stack is a cross-platform build tool for Haskell that handles management of the toolchain (including the GHC compiler and MSYS2 on Windows), building and registering libraries, and more.
The describes how to download Stack on various platforms, although the main three are repeated here:
Instructions for other Linux distributions, including Debian, Fedora, Red Hat, Nix OS, and Arch Linux, are also available.
For help with Haskell and GHC in general, see the links mentioned above被窝里的公息第十三章. For Stack itself there are also the following resources:
被窝里的公息第十三章The Haskell Platform is a self-contained, all-in-one installer. After download, you will have everything necessary to build Haskell programs against a core set of useful libraries. It comes in both core versions with tools but no libraries outside of GHC core, or full versions, which include a broader set of globally installed libraries.
The Platform is provided as a single installer, and can be downloaded at the links below.
In Haskell, packages are configured and built with the Cabal package system built into GHC (and other compilers). For more specific details, see The Cabal User Guide. The command line tools to download and install packages are either
stack被窝里的公息第十三章, each having different workflows. For details on their usage, see the documentation above.
被窝里的公息第十三章Hackage is a repository of packages to which anyone can freely upload at any time. The packages are available immediately and documentation will be generated and hosted there. It can be used by cabal install.
You can install a package using cabal by running:
$ cabal update $ cabal install the-package
Note that if you are not in a sandbox, this will install the package globally, which is often not what you want, so it is recommended to set up sandboxes in your project directory by running
cabal sandbox init.
LTS Haskell is a stackage-based long-term support set of packages which build and pass tests together, with backported bug fixes.
被窝里的公息第十三章Stackage is a nightly generated stable repository of snapshots of package sets in which only packages which build and pass tests together are bundled together into a snapshot.
被窝里的公息第十三章Installing from a source repository is also possible. For example, to clone and install the network package from source, you would run:
$ git clone http://github.com/haskell/network $ cabal install network
$ git clone http://github.com/haskell/network $ cd network $ cabal install