Skip to content

Warn about unused dependencies

GHC loads packages lazily, so at the end of compilation (at least in --make mode) it knows all the dependencies, required to compile the code. See eps_PIT in ExternalPackageState. If we compare this list with the list of packages, passed on command like via --package-id, then we'll get a list of unused dependencies.

I propose to add a flag -Wunused-packages, off by default, which will report the unused packages if any.

Trac metadata
Trac field Value
Version 8.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information