Remember the AvailInfo for each IE
ClosedPublic

Authored by alexbiehl on Aug 16 2017, 3:00 PM.

Details

Summary

This is another take on https://phabricator.haskell.org/D3844.

This patch removes then need for haddock to reimplement the calculation of exported names from modules. Instead when renaming export lists ghc annotates each IE with its exported names.

Haddocks current export logic has caused lots of trouble in the past (on the Github issue tracker):

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alexbiehl created this revision.Aug 16 2017, 3:00 PM
alexbiehl retitled this revision from [RFC] Remember the AvailInfo for each IE This is another take on https://phabricator.haskell.org/D3844 to [RFC] Remember the AvailInfo for each IE.Aug 16 2017, 3:01 PM
alexbiehl edited the summary of this revision. (Show Details)

Instead of always storing the AvailInfo for each IE I could create a new field tcg_rn_exports_avails :: Maybe [Avails] or something in TcGblEnv. This way we could store them only when given the -haddock flag.

alexbiehl edited the summary of this revision. (Show Details)Aug 17 2017, 2:59 AM
alexbiehl updated this revision to Diff 13573.Aug 21 2017, 12:34 AM
  • Revert "[RFC] Remember the AvailInfo for each IE"
  • Store Avails separately
alexbiehl updated this revision to Diff 13576.Aug 21 2017, 11:46 AM
  • Revert "Store Avails separately"
  • Revert "Revert "[RFC] Remember the AvailInfo for each IE""
  • Use Avails type
alexbiehl updated this revision to Diff 13577.Aug 21 2017, 11:49 AM
  • Use Avails throughout
alexbiehl updated this revision to Diff 13580.Aug 21 2017, 1:37 PM
  • Revert "[RFC] Remember the AvailInfo for each IE"
  • Store Avails separately
  • Revert "Store Avails separately"
  • Revert "Revert "[RFC] Remember the AvailInfo for each IE""
  • Use Avails type
  • Use Avails throughout
  • Data instance for AvailInfo
alexbiehl updated this revision to Diff 13581.Aug 21 2017, 1:40 PM
  • forgot pragma
bgamari requested changes to this revision.Aug 21 2017, 4:44 PM

Just a couple of minor requests.

compiler/typecheck/TcRnExports.hs
173–177

A docstring explaining this type would be appreciated.

compiler/typecheck/TcRnTypes.hs
617

Perhaps explain the relationship between the elements of this tuple.

This revision now requires changes to proceed.Aug 21 2017, 4:44 PM
alexbiehl updated this revision to Diff 13592.Aug 22 2017, 2:45 AM
alexbiehl edited edge metadata.
  • Comments
alexbiehl retitled this revision from [RFC] Remember the AvailInfo for each IE to Remember the AvailInfo for each IE.Aug 23 2017, 11:43 PM

Looks reasonable to me, although I do want to check for changes in allocation before we merge it. Where can the corresponding haddock changes be found?

ezyang accepted this revision.Aug 24 2017, 9:04 PM

I like the new approach!

bgamari accepted this revision.Aug 29 2017, 6:22 PM

Cool, looks good to me!

This revision is now accepted and ready to land.Aug 29 2017, 6:22 PM

@bgamari What's the status here?

@bgamari What's the status here?

It's been waiting for me to get a chance to do a batch of merges. I just arrived in Oxford so should be able to sit down and get this down this afternoon. Sorry for the wait!

alexbiehl added a comment.EditedSep 4 2017, 6:52 AM

No problem. Wish you a great time on ICFP. Wished I could join you there!

This revision was automatically updated to reflect the committed changes.