-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Derive Max (a + n) (b + n) = Max a b + n
#35
Comments
I'm attempting to implement this myself, rewriting
I guess I've broken the usual natnormalisation that goes on? Is there an easy way to get it back? Diff: https://github.com/clash-lang/ghc-typelits-extra/compare/master...isovector:plus-max?expand=1&w=1 |
Yeah, do
instead. That will stop |
That does it, cheers! PR incoming! |
Does your PR handle?
|
Nice catch --- no, it doesn't. I assumed commutativity would be handled by natnormalise? |
Yeah. Sadly |
Dang. What do you think is the move here? Use |
Discovered |
Nice, I can live what that solution for now. It will still fail for
We can call https://hackage.haskell.org/package/ghc-typelits-natnormalise-0.7.6/docs/GHC-TypeLits-Normalise-Unify.html#v:normaliseNatEverywhere to actually use the |
tl;dr: This patch doesn't actually help me in the real world. Am I expecting natnormalise to do too much? My original use case, however, doesn't seem to work yet. The constraint I'm trying to solve:
which under natnormalise should simplify to (IIUC):
and now under the new rules, should be:
and then I'd expect the subtractions to cancel:
after some simplification by hand:
and then
Here, we have |
No description provided.
The text was updated successfully, but these errors were encountered: