Haskell - Github Repos as Haskell Dependencies

Posted on March 22, 2019

Thanks to @samderbyshire I’ve figured out how to use the library I’ve written into one of my other project without publishing it to stackage or hackage. It’s similar to what I do in node and bower. Which is to include it in the config file.

Create a cabal.project file and include the following

source-repository-package
  type: git
  location: git://github.com/[repo owner]/[the repo you want to include].git

packages: ./*.cabal

Then in the *.cabal file include the repository under the build-depends section

build-depends: base ^>= 4.11.1.0
             , the-repo-you-want-to-include

Running cabal new-build should fetch this repository from github and add it to the dependencies that the project can use.