Generated by GPT-5-mini| Stack (Haskell) | |
|---|---|
| Name | Stack |
| Author | FP Complete |
| Initial release | 2015 |
| Programming language | Haskell |
| Operating system | Cross-platform |
| License | BSD-3-Clause |
Stack (Haskell) Stack is a cross-platform build tool and project manager for the Haskell programming language created and maintained primarily by FP Complete contributors. It provides reproducible builds, curated package sets, an integrated workflow for GHC toolchain management, and opinionated defaults intended to simplify development for engineers working on projects ranging from small libraries to large applications used in production by organizations such as Anchor, GitHub, and Commercial Haskell adopters. Stack complements and interoperates with other Haskell tools and ecosystems including Cabal, Hackage, Stackage, and GHCJS.
Stack originated as a response to challenges faced by Haskell developers using Cabal and disparate package sets, emphasizing reproducibility and stability through fixed snapshots of packages published on Stackage. The project was influenced by package and build systems from other ecosystems such as Bundler (Ruby), Cargo (software), and Nix (package manager), while being shaped by Haskell research and tooling efforts at institutions like Well-Typed, IOHK, and Microsoft Research. Stack automates retrieval of the Glasgow Haskell Compiler distribution, configuration of isolated project environments, and resolution of dependency variants against curated snapshots maintained by the Stackage community and organizations like FP Complete.
Stack's core features include reproducible snapshot-based dependency management via Stackage, project scaffolding, multi-package workspace support, and tight integration with the GHC toolchain. Components of Stack include the CLI executable developed in Haskell (language), YAML-based project descriptors, and pluggable build backends that can invoke Cabal (software). It provides sandbox-like isolation similar in spirit to virtualenv from the Python (programming language) ecosystem and versioned resolver selection comparable to NixOS channel pinning. Stack also supports cross-compilation targets such as GHCJS and has features for generating documentation using Haddock and continuous integration hooks for services like Travis CI, GitLab CI, and CircleCI.
Developers typically initialize a repository with stack using template-driven commands influenced by templates from GitHub and Template Haskell tooling, producing a stack.yaml file that pins a resolver from Stackage Nightly or Stackage LTS. Common commands mirror other ecosystems' CLIs — build, test, repl, and run — and interact with GHC and Cabal under the hood. Workflows often incorporate editor integrations for Visual Studio Code, Emacs, Vim, and IntelliJ IDEA via community plugins, and continuous integration setups used by teams at Facebook, Mozilla, and Atlassian favor Stack for reproducible artifacts. Stack can fetch specific GHC binaries from download mirrors, compile GHC from source using scripts influenced by Make (software), and manage multiple resolvers for multi-crate (multi-package) repositories akin to monorepos employed by Google and Facebook.
Stack uses a hierarchical configuration approach centered on stack.yaml supplemented by package.cabal files authored according to Cabal (software) specification. The stack.yaml contains fields such as resolver, packages, extra-deps, and flags to control build behavior and select snapshots from Stackage. Projects may include global.yaml or per-project overrides similar to configuration layering found in Docker and Kubernetes manifests. Package metadata in .cabal files references library sections, executable stanzas, test-suite entries, and benchmark blocks, each aligning with formats documented by the Haskell Platform community and standards discussed at Haskell Symposium events.
Stack was designed to interoperate with the broader Haskell ecosystem, working with Cabal, Hackage, and editors through Language Server Protocol implementations like haskell-language-server. It enables generation of build artifacts consumable by tools such as Criterion (software) for benchmarking and QuickCheck for property testing, and integrates with documentation tooling like Haddock and packaging workflows for distribution on Hackage. Stack's resolver model aligns with dependency resolution research from Simon Peyton Jones-led discussions and has been adopted in corporate environments alongside Nix-based workflows and containerization patterns used with Docker.
The Stack project is an open-source effort with contributions from individuals and companies in the Haskell community, coordinated via repositories hosted on GitHub and discussions in channels connected to conferences such as Strange Loop and IOHK community events. Core maintainers have included engineers associated with FP Complete and contributors who previously worked on Cabal-install and the GHC codebase. Roadmaps and feature proposals have been reviewed at community fora like the Haskell Weekly newsletter and presented at venues including ZuriHac and Haskell eXchange.
Criticism of Stack has centered on its divergence from the native Cabal workflow, leading to duplicated concepts and occasional friction when integrating with tools expecting cabal-install idioms. Some organizations and contributors prefer Nix for deterministic builds and system-wide package management, citing differences in reproducibility guarantees compared to Stack's resolver snapshots. Complex multi-repository monorepo setups and projects requiring non-standard linker flags or deep C interop have reported limitations or require manual intervention, echoes of issues previously debated in Haskell mailing lists and at Haskell Implementors Meeting (HIM). Stack's reliance on external binary distribution channels and the maintenance burden of resolver updates have also been discussed in project governance meetings and public issue trackers hosted on GitHub.