Skip to content

Commit 9cab3d4

Browse files
committed
Added information about how to add Haskell dependencies
1 parent 2672187 commit 9cab3d4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,20 @@ cabal install
6060

6161
Any module that is meant to be consumed as a library needs to be listed in the `exposed-modules`. Any module that is not listed there are considered to be private modules.
6262

63+
The `package.yaml` is also where you list new Haskell packages. For example if you want to get the `algebraic-graphs` library, you basically use:
64+
65+
```yaml
66+
dependencies:
67+
- base >= 4.7 && < 5
68+
- algebraic-graphs >= 0.2 && < 0.3
69+
```
70+
71+
Then you use `cabal2nix` again and you re-enter the shell.
72+
73+
Note that Haskell dependency constraints and versions when using `cabal2nix` is not determined by your `package.yaml`, but instead by the Nixpkgs hash located in `pkgs.nix`.
74+
75+
Remember that Haskell package versions conventionally use `Major.Major.Minor.Patch`. For more information see: https://pvp.haskell.org/
76+
6377
## Using GHCi (or `cabal repl` or `stack ghci`)
6478

6579
The `cabal repl` only works against the build targets specified in the `package.yaml`. You have to specify the target name:

0 commit comments

Comments
 (0)