Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Merging mi_exports and docs_structure #956

Open
@sjakobi

Description

@sjakobi

The problem

mi_exports and docs_structure both contain the same AvailInfos, 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:

  1. They are extracted/renamed in TcRnExports.exports_from_avails.
  2. Assigned to tcg_exports in tcRnExports
  3. Copied to mg_exports in deSugar
  4. In mkIface_, they are sorted with MkIface.mkIfaceExports and assigned to mi_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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions