Skip to content

Adding Dependencies

aidandenlinger edited this page Nov 9, 2022 · 2 revisions

We're using Stack, a Haskell project manager. Adding dependencies is documented here, but it was a bit of a pain to really piece it together. I'm noting what worked for me here

  • Check Stackage LTS 19.32 to see if the package is there. If it is, then the package is already included and we don't need to change the stack.yaml.
    • If it isn't in the stackage, you need to add it to extra-deps in stack.yaml. You add package-name@version in extra-deps.
  • Then, go to package.yaml and add - package-name under dependencies. In most cases this should go under library's dependencies to access it from the src folder.
    • If it's needed for app/Main.hs it should go under executable
    • If it's needed for anything in test it should go under test
  • If all goes well, it should successfully build with stack build, or run with stack run, or test with stack test.
Clone this wiki locally