Skip to content

Commit 505d0e7

Browse files
committed
update(c01): add more about package managers
1 parent 110b9d4 commit 505d0e7

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

haskell-for-rustaceans/src/ch01-01-tooling.md

+18-5
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,30 @@ The Haskell tooling consists basically of the following:
66
| --------------- | ------------------------- | --------------- |
77
| Installer | `ghcup` | `rustup` |
88
| Compiler | `ghc` | `rustc` |
9-
| Package manager | `cabal` | `cargo` |
9+
| Package manager | `cabal-install` | `cargo` |
1010
| Language Server | `haskell-language-server` | `rust-analyzer` |
1111

12-
Use [GHCup][ghcup] to install the whole toolchain. You should figure it out pretty easily, it is quite similar to `rustup`
13-
and works on Windows, MacOS and Linux.
12+
Use [GHCup][ghcup] to install the whole toolchain. You should figure it out pretty easily, it is quite similar to
13+
`rustup` and works on Windows, MacOS and Linux.
1414

15-
If you are using Linux, avoid using your distribution's package manager, unless
16-
you are using NixOS.
15+
If you are using Linux, avoid using your distribution's package manager, unless you are using NixOS.
1716

1817
> **NOTE**: GHCup doesn't work on NixOS. Use the Nix package manager to install the toolchain. Refer to the
1918
> [Haskell][nixos-wiki-haskell] page on NixOS Wiki for further information.
2019
20+
## More about package managers
21+
22+
If you have seen some projects or browsed Haskell related content on the internet there is a chance that you might have
23+
stumbled upon another Haskell package manger: `stack`. You might be wondering why did we chose `cabal-install` over
24+
`stack`. The answer is simple: `cabal-install` is arguably simpler. It doesn't try to manage GHC or any other tooling
25+
for you like `stack` does. There can be held a whole debate on to which one to choose. So we won't dwell on the topic.
26+
The main thing you **need** no know is: both of them use the same library under the hood anyways. `cabal` is a library
27+
that is used by both of the aforementioned package managers. We recommend using `cabal`.
28+
29+
Also, note that `cabal-install` provides the `cabal` executable. Hence, `cabal-install` is sometimes referred to as
30+
`cabal` for the sake of simplicity. We'll consistently use `cabal-install` to refer to the package and `cabal` for the
31+
library to avoid ambiguity. But be aware that in other sources or discussions, you might encounter `cabal` being used to
32+
mean either the library or the executable.
33+
2134
[ghcup]: https://www.haskell.org/ghcup/
2235
[nixos-wiki-haskell]: https://nixos.wiki/wiki/Haskell

0 commit comments

Comments
 (0)