WIP: Fix n <= 0
constraint being reported as impossible.
#83
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.
The problem is in:
ghc-typelits-natnormalise/src-ghc-9.4/GHC/TypeLits/Normalise.hs
Lines 506 to 524 in 84f500a
Given a constraint of
a <= 0
thensubtractIneq
will turn that into-a
andisNatural
will report it as not a natural. The approach in this PR obviously doesn't work. There is a ton of fallout in the other plugins... So I need to think of something else.The first commit tried a "proper" fix but there is fallout of tests failing on old GHCs and I tried to compile clash-compiler with it and a ton of breakage occured in
ghc-typelits-extra
. The second commit added a hack which does not have the problem of fallout. But doesn't work on older GHC due toa <= 0
turning up as a wanted.Pinging the guru @christiaanb.