How To List Dependencies In Haskell

by||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. In this article we will see how to list all dependencies including the version.

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 Twitter (@debilofant) with comments, or feel free to follow. Please like/share this article so that it reaches others as well.

© Copyright 2022 - Ersocon - All rights reservedVer. 2.3.5.2