this post was submitted on 18 Apr 2026
1 points (100.0% liked)

Haskell

632 readers
2 users here now

founded 2 years ago
MODERATORS
 

Hi, I'm a beginner when it comes to Haskell, but I guess I'm somewhat comfortable with the language itself. I'd love to try building some stuff using it. However, I'm finding it very hard to properly use external libraries/packages.

I'm familiar with Rust's cargo, and go's package management system, and feel very comfortable using them. Are there similar ones for Haskell? Basically, I want them defined per project, and not have to install everything system-wide. I'd like to be able to provide users with simple instructions for replicating the whole build setup.

What's the idiomatic way? Are there any example packages that I can look at that are not too complicated?

top 4 comments
sorted by: hot top controversial new old
[–] Noughtmare@programming.dev 0 points 6 days ago

Cabal is more than sufficient for my purposes nowadays. I'd recommend reading their Getting Started page:

https://cabal.readthedocs.io/en/3.10/getting-started.html

That gives an overview of the basic functions and for example how to add new dependencies.

For setting up the entire toolchain, I'd also recommend GHCUp's first steps guide:

https://www.haskell.org/ghcup/steps/

[–] thestrike@lemmy.blahaj.zone 0 points 1 week ago

The ones I have seen that are per-project are stack and nix, and cabal is used for system-wide

[–] aka_dude@mk.phreedom.club 0 points 1 week ago

@SinTan1729@programming.dev try stack. take latest LTS snapshot from stackage. use package.yaml, don't write *.cabal files by hand. that should be it, the rest will be cargo-like experience
you can tag me/dm me if you have issues

This repo has significantly improved determinism in Haskell builds: https://github.com/input-output-hk/haskell.nix