Haskell World logo Haskell WorldWrite code, build worlds
Developer Tools

Haskell Stack vs Cabal and Which Build Tool to Pick

You open a new Haskell project and the first decision is already a fork in the road: Stack or Cabal. Pick wrong and you spend the next month fighting resolver errors, slow CI and teammates who build with a different tool than you do.

Laptop on a wooden desk showing a terminal with build output next to a notebook and a cup of coffee

You open a new Haskell project and the first decision is already a fork in the road: Stack or Cabal. Pick wrong and you spend the next month fighting resolver errors, slow CI and teammates who build with a different tool than you do. The Haskell Stack vs Cabal question used to be a real war, but in 2026 the two tools overlap far more than the old forum threads suggest, and the honest answer depends on three or four concrete facts about your project.

I maintain a handful of open source libraries and one internal service that has switched tools twice. This is what I would tell a team picking today.

What each tool actually does

Both tools read the same .cabal package description. That is the part people forget. A package that builds with one can almost always build with the other, because the package format, the module list and the dependency bounds live in the same file. The difference is how each tool decides which versions of your dependencies to use.

Cabal (the cabal-install command line tool) runs a solver against Hackage. You give it version bounds, it finds a set of package versions that satisfy every bound, and it builds them into a shared store so the next project can reuse them. Reproducibility comes from two settings in cabal.project: an index-state timestamp that freezes what Hackage looked like on a given day, and a cabal.project.freeze file that records exact versions.

Stack skips the solver for most cases. It uses a Stackage snapshot, a curated set of roughly 3,000 packages that are known to build together on one specific GHC version. You name the snapshot in stack.yaml, and every developer and every CI runner gets the same versions without thinking about it. Packages outside the snapshot go in an extra-deps list with exact versions.

Haskell Stack vs Cabal on the points that matter

Here is the comparison I use, limited to what changes daily work.

QuestionCabalStack
How versions are chosenSolver plus your boundsCurated snapshot plus extra-deps
Pinning for reproducible buildsindex-state and a freeze fileSnapshot name in stack.yaml
Installing GHCUsually through GHCupCan download GHC itself, or defer to GHCup
Newest GHC on release dayWorks as soon as packages allowWaits for a nightly or LTS snapshot
Publishing to HackageNative, bounds are tested by the solverWorks, but bounds are not exercised
Learning curve for newcomersA bit steeper on day oneGentler on day one

Notice that GHC installation is no longer a real differentiator. GHCup installs GHC, cabal-install, Stack and the language server in one place, and recent Stack versions can hand GHC management over to it. If your setup still has two copies of GHC fighting over your PATH, the walkthrough in setting up a Haskell development environment fixes that before anything else.

When Cabal is the better choice

Choose Cabal when you publish libraries. A library on Hackage will be built by strangers with versions you never tested, and the only way to know your bounds are honest is to let a solver test them. A common CI matrix for a library runs Cabal on three GHC versions, for example 9.6, 9.8 and 9.10, once with the newest versions the solver can find and once with a constraint set that forces the oldest allowed versions. Stack cannot run that second job naturally, because it never explores the version space.

Cabal also wins when you need a brand new GHC in the first weeks after release. Snapshots lag, sometimes by a month or more, while Cabal will happily build as soon as your dependencies have relaxed their base bounds.

Finally, Cabal's shared store pays off on a laptop with many projects. Ten projects that use the same version of aeson compile it once.

When Stack is the better choice

Choose Stack for applications with a team of mixed experience. A service with six developers, two of them new to Haskell, benefits enormously from "everyone uses LTS snapshot X, full stop." Nobody wakes up to a solver picking a new minor version of a JSON library that changed an instance. Upgrades become a single, reviewable pull request that bumps one line.

Stack also suits teaching and workshops. You can hand 30 students a repository with a stack.yaml and be fairly confident that 28 of them will build it on the first try. With Cabal you can reach the same result, but you have to remember to commit a freeze file and an index-state, and newcomers rarely know why those files matter.

The advice I disagree with

The most repeated advice online is "Stack is reproducible, Cabal is not." That was true around 2016. It has not been true for years, and repeating it pushes teams toward Stack for the wrong reason.

A Cabal project with a committed cabal.project.freeze and a pinned index-state rebuilds the same dependency versions on every machine. I tested this on the internal service: same freeze file, three machines, two operating systems, identical build plans. What Cabal does not give you is someone else's curation. That is the real trade. Stack outsources the question "do these versions work together" to the Stackage maintainers. Cabal makes you answer it with your own bounds and tests.

So the useful question is not "which one is reproducible." It is "do we want to own our dependency choices, or borrow a curated set." Library authors usually want to own them. Application teams often prefer to borrow.

Switching later without pain

Because both tools share the .cabal file, switching is cheaper than it looks. A few habits keep the door open:

  1. Keep real version bounds in your .cabal file even if you use Stack. Stack ignores most of them, but they let you move to Cabal in an afternoon.
  2. Avoid hpack-only features if you might leave Stack. If you use package.yaml, commit the generated .cabal file too.
  3. Write CI scripts that call the build tool in one place, so swapping it touches one file instead of twelve.

Editor tooling works with both. The language server detects the project type through its cradle, and most "HLS cannot find module" errors after a switch come from a stale cradle. The fixes in Haskell Language Server troubleshooting for real projects cover the usual cases. For more comparisons of this kind, the developer tools section collects our editor and build guides.

A simple rule to decide

If you are writing a library that other people will install, use Cabal and test your bounds in CI. If you are writing an application with a team, and nobody has a strong preference, start with Stack on the current LTS snapshot. If you need a GHC that came out last month, use Cabal. If your team already knows one tool well, that familiarity beats every row in the table above.

Frequently asked questions

Can I use Stack and Cabal in the same project?

Yes, and many open source projects do. Keep a stack.yaml and a cabal.project side by side, both reading the same .cabal file. The cost is that CI must build with both, or one setup will quietly rot within a few months.

Is Stack still maintained in 2026?

Yes. Stack still gets regular releases and Stackage keeps publishing LTS and nightly snapshots. Its role has narrowed toward curated application builds, while GHCup took over most installation work, but it is far from abandoned.

Which build tool should a Haskell beginner learn first?

Learn whichever tool your course, book or team uses, because the concepts transfer. If you are on your own, Cabal through GHCup is a solid default since every Hackage package documents itself for it. You will meet the other tool eventually, and the shared .cabal file makes that easy.

SR
Sonja Reiter

Sonja Reiter contributed to three major open source projects and started writing documentation when she noticed most tooling guides were written by people who had never taught anyone to use them. She covers build tools, package ecosystems, and the invisible quality-of-life differences between development setups.

More posts by Sonja

More in Developer Tools

01doorganico 084goad 3hot8 4465456 after5internprogram ahandfulofblessings ahmadpc ahomcybersecurity allodialresources annodex antiquesandperiodcollectibles aotc asianworldkashmir beedlectrics bloggertemplatefree bluefeatheragency bodyweightsolution campaign08blog carfixadvisor catstreetcollective cbstvsports cnfanspurchasing committeeof500yearsofdignityandresistance covertopsdjs cs-kaiyuangame cuestacomunicaciontotal cxoutlet dancebetgame deskgearhub destinyvillastay detectmagazine di33 diamondsteelbuildings donmo dyanadropship emarsysfinance emimattl escapechan eskitarih evautoplay everythingweddings-orlando farmzone feedviewerapp foxstudiosscratch gamevui123 gleasongrade greetingsday hacklabasu iw-kaiyun jagoanproperti jilidskripsi joltbusinessfinance juegodepokergratis juegospucca kaeru-festival latestmehndidesigns lestanzediottaviano litemagazines localcommunityhero lustrsazan mariashebets menswheels newwebstechs1 nikkit ootheday oxigenvpn plurfitness prefetial probudgetcarpetcleaning psychicmrsmartin pyaten qvantor rejoignezlogis rexzbot riselayouts ruchin rwxqsgd5 sakaltime shibiaowang shop-bot skrtips spotlesshaven strcoding tetapatrium topselller uneplanteartificielle vipertechcr webtech1223411 wo-kygaming yamaha-mekar yeknava yoybuysheets zenunwa yamaha-mekar jilidskripsi ankertoto ankertoto ankertoto