How To List Dependencies In Haskell

by|inArticles||1 min read
How to list dependencies in Haskell
How to list dependencies in Haskell

In recent cabal or stack projects it is not very obvious which versions of the dependencies are used. This article is going to show you how to list all dependencies, including their version, in order to build a complete project.

In fact we can list all dependencies by adding a dependency to the project: cabal-plan. This way cabal needs only to finish the cabal configure step to be able to list the dependencies.

With the cabal-plan installed you can now run cabal-plan in the terminal:

cabal-plan

This command should give you a complete list of the dependencies and the corresponding version used in the project. If you are searching for a specific dependency you can as well pipe the output to grep:

cabal-plan | grep servant
    │   ├─ servant-server-0.18.3
    │   ├─ servant-server-0.18.3 ┄┄
    ├─ servant-server-0.18.3 ┄┄
 ├─ servant-server-0.18.3 ┄┄
    ├─ servant-server-0.18.3 ┄┄
    │   ├─ servant-server-0.18.3 ┄┄
    │   │   ├─ servant-server-0.18.3 ┄┄
    ├─ servant-server-0.18.3 ┄┄
 ├─ servant-server-0.18.3 ┄┄
 ├─ servant-server-0.18.3 ┄┄
 ├─ servant-server-0.18.3 ┄┄
UnitId "servant-server-0.18.3-EZ46RmcXwcx2HgApmqWG01"
  servant-server-0.18.3
  servant-server-0.18.3
  servant-server-0.18.3
  servant-server-0.18.3
  servant-server-0.18.3

Thank you for reading this far! Let’s connect. You can @ me on X (@debilofant) with comments, or feel free to follow. Please like/share this article so that it reaches others as well.

Related Articles

© Copyright 2024 - ersocon.net - All rights reservedVer. 415