Avoiding recompilation when export lists expand
I was reading https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/recompilation-avoidance
and it says:
for a module that was imported, the export-list fingerprint of the imported module is recorded. If any of the modules we imported now has a different export list we must recompile, so we check the current export-list fingerprints against those recorded in the usages.
I'm not sure if GHC is being overly pessimistic here, or if this is actually necessary (maybe something to do with typeclasses?).
If a downstream module has an explicit import list, is it necessary to recompile if a new export is added?
For instance, a common pattern is to have a Types.Ids
module that exports a newtype FooId = FooId Int
for each domain type.
This means that whenever a new export is added basically every module recompiles, even though they often have an explicit import list and only use a small subset of these types.