Repository navigation
Fix type-family reduction over data-family representations (copy #3549) - #3579
Closed
mergify[bot] wants to merge 1 commit into
Closed
mergify[bot] wants to merge 1 commit into
mergify[bot] wants to merge 1 commit into
Conversation
Retain the source family application on GHC representation constructors so family matching can recover fixed kinds and structured indices. Support higher-kinded representations through eta reduction and preserve newtype- family identity during specialization. (cherry picked from commit 88bf4fe)
Member
|
Next release will be major so closing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
GHC introduces internal representation constructors for data-family instances.
ghc2corereduces concrete family applications to these representations, losing the source family form needed for later type-family matching. So when you have:Unsigned (Width (Tagged 'True))gets rewritten toUnsigned (Width (R:TaggedBoollabel 'True))during translation and specialization. GHC records this through a coercion axion, but Clash loses that information.This PR fixes this by adding
tyConFamilyInst :: !(Maybe ([TyVar], Type))toAlgTyCon. This records the original data-family application, which is then used during normalization to match the type-family equation.Still TODO:
This is an automatic copy of pull request #3549 done by [Mergify](https://mergify.com).