Use GHC Name after resolving asserted specs #2421
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is another step for #2169.
The first two commits are small refactorings. The one about putting the types from the core program in the type environment (072cb95) is important to mimic the current behavior: when types are different in core and in the typing environment, prefer the type in core. The types should be always alpha equivalent. It also puts the types of non-top-level variables in the typing environment, so we can simplify lookups a bit.
The general structure of introducing LHNames follow. First 2074e96 introduces LHName at the places of the AST where asserted specs are kept. And the follow up commits remove the conversions from LHName to symbol that helped preserving the old behavior.
Near the end, we get a nice commit (1d33cce) that removes a bit of redundant renaming code in LH (redundant with respect to the name resolution that we can do more directly with the GHC API).