Search code examples
haskellghccabal

Visualize a dependency graph of packages for a cabal project?


There is ghc-pkg dot but that seems to only work for a ghc package database.


Solution

  • You can use the cabal-plan executable to generate a dependency graph. First install cabal-plan with:

    cabal install cabal-plan
    

    Then you can go to your cabal package directory and run:

    cabal-plan dot | dot -Tpdf -odeps.pdf
    

    (You have to run cabal build or cabal configure first if you have not done so already)

    This will produce a dependency graph in PDF form in the file deps.pdf.