/cabal-dependencies

extract dependencies from a Haskell project (cabal files) and analyze with Prolog for direct and transitive dependencies among packages

Primary LanguageHaskellBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

cabal dependencies

this tool extracts dependencies from Cabal files and prints them as Prolog terms for further processing.

direct dependencies are labelled "1", and transitive dependencies "2".

extraction

using stack

stack build

stack exec cabal-dependencies-exe ../my-other-project/project.cabal > dependencies.pl

using cabal

cabal new-build

cabal new-run cabal-dependencies-exe ../my-other-project/project.cabal > dependencies.pl

analysis

prints out a list of all dependencies.

swipl -q -t go depdep.pl > dependencies.csv

prints out a list of modules defined by the cabal files.

swipl -q -t go2 depdep.pl > modules.csv

example

analysed the dependencies in a huge project (Cardano-SL).

this project contains more than 20 modules.

the CSV data have been loaded into a LibreOffice calc sheet for visualisation. example