feat: Implement Eq and Hash for Property#94
Draft
RobertJacobsonCDC wants to merge 2 commits intomainfrom
Draft
Conversation
8 tasks
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.
This is an experimental branch that is compatible with this ixa branch. It changes all instances of
f64to useOrderedFloat<f64>.This PR only exists for visibility. We won't merge this.
It turns out that using
OrderedFloat<f64>is really obnoxious. Even thoughOrderedFloat<f64>implements all the usual operations, you still can't mixf64andOrderedFloat<f64>for comparisons, for example.OrderedFloat<f64>implementsDeref<f64>/DerefMut<f64>, but that's not a silver bullet. You end up either calling into to upcast yourf64values toOrderedFloat<f64>, or you downcast yourOrderedFloat<f64>values tof64. And both ways of downcasting are obnoxious in mathematical code! You have your choice of a deref operator, an*, which looks like multiplication, or using the tuple field accessor syntax,ordered_float.0, which just as gross when you use it in a mathematical formula. You could try to only ever useOrderedFloat<f64>, avoiding nakedf64entirely. But you don't always have that option. Both the standard library and ixa usesf64for various things like time for example. Theordered-floatcrate does have a feature flag forrandsupport, though.Local Benchmark Results
main (33ab8db) vs RobertJacobsonCDC_eq_hash