LinuxmacOSWindows

Where Does Haskell Store Toolchains and Packages?

Haskell toolchains live in ~/.ghcup with package data in ~/.cabal and ~/.stack, while projects build into dist-newstyle or .stack-work.

Last updated

Haskell splits state three ways, and each layer has its own folder. GHCup manages toolchains under ~/.ghcup. Cabal keeps its package store and config under ~/.cabal (and ~/.config/cabal on newer setups). Stack keeps snapshots and programs under ~/.stack. Projects then build into their own output folders.

That layering tells you what is safe to delete. Project output folders regenerate from the package description and lock plans. The home-directory stores are shared caches: wiping them only costs re-download time, never source, but on big projects that time is considerable.

Where Haskell stores this, by platform

Linux
~/.ghcup

GHC, cabal-install, HLS, and Stack versions managed by ghcup. ghcup list shows what is here; compilers installed by system packages live elsewhere and bypass it.

macOS
~/.ghcup

Same ghcup home on macOS for Intel and Apple silicon. Xcode CLT upgrades occasionally break bindists here, which presents as GHC panics rather than missing files.

Windows
%USERPROFILE%\.ghcup

Same layout under the user profile. Long paths in the cabal store occasionally break Windows builds; a short store location avoids the worst of it.

Frequently asked questions

Which GHC am I actually using?

Run ghcup list to see managed toolchains. ~/.ghcup holds GHC, cabal, HLS, and stack versions it installed; manually installed toolchains elsewhere are invisible to it.

A Haskell build is stale or broken. What do I wipe?

Delete dist-newstyle (or .stack-work) plus the project .ghc.environment file. Both regenerate from the .cabal file and freeze plan. The ~/.cabal store and ~/.stack snapshots persist and stay valid.

Notice an outdated path? Let us know.