-
Notifications
You must be signed in to change notification settings - Fork 164
change negate of Num Bit from complement##
to id
#3000
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
Conversation
@MrDurion Could you add a changelog entry? thanks! |
d913fd7
to
1f31ba9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a regression test and a change log entry. This PR now LGTM.
1f31ba9
to
63ae22e
Compare
, testAdditiveInverse "Index 1" (genIndex @1) | ||
-- TODO: | ||
-- , testAdditiveInverse "Index 2" (genIndex @2) | ||
-- , testAdditiveInverse "Index 128" (genIndex @128) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The additive inverse, and thus negate, is not defined for Index
because the definition requires closure, which Index
does not have for addition (maxBound + 1 => errorX). So you can remove these tests (and perhaps we should give thought to removing negate
for Index
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, could you add your thoughts under #3015?
This PR corrects an error where the
negate
of theNum Bit
instance used the complement instead of the identity function.The negate is the additive inverse, and for xor as the addition operator, the inverse should be the identity, not the complement.
Fixes: #2999
Still TODO: