Make NuMatchingAny1Proof
an alias for a quantified NuMatching
constraint
#8
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.
Previously, there was a global
INCOHERENT
instance of the form:This does not combine well with GHC 9.0+'s Template Haskell splice behavior, where instances written after a top-level declaration splice are not visible to instances written before the splice. In particular, this affects which instances GHC will consider when resolving instance overlap w.r.t. incoherent instances, so if you are not careful with the ordering of instances and TH splices, you can accidentally change the runtime behavior of your program. For more information, see GaloisInc/saw-script#1742 and https://gitlab.haskell.org/ghc/ghc/-/issues/22492.
This patch removes the
INCOHERENT
instance and instead makesNuMatchingAny1
an alias for a quantified constraint involvingNuMatching
:(Alternatively, we could have made this a type synonym, but using a class has the advantage of not forcing downstream libraries to enable
QuantifiedConstraints
everywhere thatNuMatchingAny1
is used.)Aside from this change, the rest of this patch simply deletes
NuMatchingAny1
instances, as the one instance above is the only instance we will ever need now.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.