Dependency visualization¶
You can use stack to visualize the dependencies between your packages and optionally also external dependencies.
First, you need Graphviz. You can get it here.
As an example, let's look at wreq
. Command:
Okay that is a little boring, let's also look at external dependencies. Command:
Well that is certainly a lot. As a start we can exclude base
and then
depending on our needs we can either limit the depth. Command:
or prune packages explicitly. Command:
stack dot --external --prune base,lens,wreq-examples,http-client,aeson,tls,http-client-tls,exceptions | dot -Tpng -o wreq_pruned.png
Keep in mind that you can also save the dot file. Command:
and pass in options to dot
or use another graph layout engine like twopi
.
Command:
stack dot --external --prune base,lens,wreq-examples,http-client,aeson,tls,http-client-tls,exceptions | twopi -Groot=wreq -Goverlap=false -Tpng -o wreq_pruned.png
Specifying local targets and flags¶
The dot
and list-dependencies
commands both also accept the following
options which affect how local packages are considered:
TARGET
, same as the targets passed tobuild
--test
, specifying that test components should be considered--bench
, specifying that benchmark components should be considered--flag
, specifying flags which may affect cabal filebuild-depends