Merging mi_exports
and docs_structure
#956
Description
The problem
mi_exports
and docs_structure
both contain the same AvailInfo
s, albeit in different order. In order to avoid bloat in the .hi
-files, we'd rather serialize each AvailInfo
only once.
mi_exports
mi_exports
seem to be created like this:
- They are extracted/renamed in
TcRnExports.exports_from_avails
. - Assigned to
tcg_exports
intcRnExports
- Copied to
mg_exports
indeSugar
- In
mkIface_
, they are sorted withMkIface.mkIfaceExports
and assigned tomi_exports
.
Ordering of avails
The docs for mi_exports
currently say:
Kept sorted by (mod,occ), to make version comparisons easier
Records the modules that are the declaration points for things
exported by this module, and the 'OccName's of those things
In order to keep the version comparisons fast, we need to ensure that the ordering of avails is deterministic.
Question: Does anything rely on the current ordering of avails that might be broken if we use export order?
In some places it might also be beneficial to have the avails in export order. For example in GHCi's :browse
.