Repository navigation
Remove Add requirement for Zero. Remove Mul requirement for One. - #388
Closed
jevgarrido wants to merge 1 commit into
Closed
jevgarrido wants to merge 1 commit into
jevgarrido wants to merge 1 commit into
Conversation
Member
It is not, as already explained on the issue.
No, we're not going to just hand-wave that away. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removing requirement Add from trait Zero.
Removing requirement Mul from trait One.
Broadens domain of applicability for traits Zero and One.
Semver-compatible modification
See #364
Visibility on consumer side
Zero does not imply Add anymore
This will now not compile
But this will
So the Add and Mul operations become more explicit.
In practice this is not really noticeable because everyone just uses Float or Num if they want to add or multiply generically.
Can implement One without Mul (and Zero without Add)
This will now compile:
This way we are able to use the Zero and One constructors right away, without worrying about the logic of adding or multiplying upfront.
Closes #364