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.
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: base ^>= 188.8.131.52 , the-repo-you-want-to-include
cabal new-build should fetch this repository from github and add it to the dependencies that the project can use.