For given cabal project how could unused dependencies packages be retrieved?
Is there a way to get something like warning during cabal install
process if there is a package mentioned in project dependency and there is no any usage of it, so it could be removed from dependencies?
I think the program packunused is what you are looking for.
There are some options:
Unfortunately, GHC 8.8 is left out.
P. S. There was recently released a program called prune-juice
that should work for GHC 8.8 too.
cabal-progdeps lists dependencies once the cabal project has been built.
You can check if thay are all used by adding an unused one to your project.
It requires the same Cabal library version used in cabal-install, otherwise it gives errors parsing dist/setup-config.
There is yet another tool:
https://github.com/ndmitchell/weeder https://hackage.haskell.org/package/weeder
It's not yet on Stackage though
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With