You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
An important aspect of Haddock is interface creation (Haddock.Interface.Create); in particular, when we create an interface, we create a list of exports which correspond one-to-one with the documentation entries that Haddock eventually output on the page.
Haddock's current algorithm for computing the list of exports is closely tied to the renamed syntax we get from the module:
If there is no export list, we simply iterate through each renamed, top-level declarations, and create an export per declaration.
If there is an export list, we process each entry in the renamed export list, successively looking up the "name" in the list of renamed declarations, and then the external packages, until it is found.
There are two problems with this strategy.
It duplicates smarts for figuring out what is "exported" with information that GHC has already computed during the renaming process. This logic duplication has lead to numerous bugs, where Haddock implements some resolution incorrectly:
Re-exports with PackageImports are not hyperlinkt #344 I'm pretty sure we implemented package imports completely incorrectly (we are slapping the package qualifier in the UnitId, but that will never match), which is why the links aren't working here.
It doesn't work for Backpack signatures, where a signature may export entities which don't have renamed declarations in the local source file (they were inherited from external signatures.)
My plan is to refactor this code so that instead of recomputing "exports" from scratch, we instead directly use the mi_exports computed by GHC as the basis for what we are exporting. This should solve the module reexport bugs.
Hazards:
I am assuming that mi_exports is sorted in the same way as the source-level exports. If it is not we'll have to do some logic to sort things correctly.
Activity
ezyang commentedon Mar 13, 2017
Actually, this refactor doesn't work. because we need to pick up IEDoc and IEDocNamed from the export lists.