Haskell Language Stack Viewing dependencies


To find out what packages your project directly depends on, you can simply use this command:

stack list-dependencies

This way you can find out what version of your dependencies where actually pulled down by stack.

Haskell projects frequently find themselves pulling in a lot of libraries indirectly, and sometimes these external dependencies cause problems that you need to track down. If you find yourself with a rogue external dependency that you'd like to identify, you can grep through the entire dependency graph and identify which of your dependencies is ultimately pulling in the undesired package:

stack dot --external | grep template-haskell

stack dot prints out a dependency graph in text form that can be searched. It can also be viewed:

stack dot --external | dot -Tpng -o my-project.png

You can also set the depth of the dependency graph if you want:

stack dot --external --depth 3 | dot -Tpng -o my-project.png