Skip to content

Many imports of the form 'import foo ()' are unused

Summary

There are two use cases for imports of the form import foo ():

  1. You're importing the module purely for instances of typeclasses
  2. You intentionally want to create a dependency on the imported module so it's built first by the build system

Unfortunately -Wunused-imports can't detect when these imports are no longer needed, meaning many fly under the radar as they become redundant over time. Removing them would get rid of unnecessary dependencies, potentially leading to greater parallelism in the build system.

This issue an offshoot of #17054 where this and other forms of unused imports are discussed.

Edited by Jess
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information