Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which cabal packages aren't being used

Tags:

haskell

cabal

If I crank up the warnings with GHC, it will warn me which imports aren't being used....

Is there a similar command to tell me which build-depends aren't being used in my <project>.cabal file?

like image 427
jamshidh Avatar asked Oct 05 '15 21:10

jamshidh


1 Answers

packunused is a simple CLI tool allows to find out which of the packages listed as build-depends in a Cabal package description file are redundant.

You have to build your project with -ddump-minimal-imports then run packunused:

cabal build --ghc-option=-ddump-minimal-imports
packunused

It will print a list of package dependencies that seem to be unused.

like image 67
frasertweedale Avatar answered Oct 18 '22 20:10

frasertweedale