Adapt to NuMatchingAny1
becoming a quantified constraint
#1774
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 makes the necessary changes to adapt to eddywestbrook/hobbits#8, which turns
NuMatchingAny1
into an alias for a quantifiedNuMatching
constraint. See #1742 and https://gitlab.haskell.org/ghc/ghc/-/issues/22492 for the motivation behind this.One unfortunate hiccup with this patch is that combining quantified superclasses and
TypeFamilies
doesn't quite work out of the box on pre-9.2 GHCs due to https://gitlab.haskell.org/ghc/ghc/-/issues/14860. As a result, I have to introduce explicit equality constraints to work around the issue. I have added aNote [QuantifiedConstraints + TypeFamilies trick]
to describe why the workaround is necessary.Credit goes to Matthew Pickering for helping me identify this issue and for authoring a separate fix. I have tweaked his fix and turned it into this patch, adding him as a co-author in the process.
Fixes #1742.