-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove Ordering from the prelude. #497
Remove Ordering from the prelude. #497
Conversation
ec90ca4
to
f133ecc
Compare
/cc @bstrie because of rust-lang/rust#17967 (comment) |
Edit: whoops, I'm in the rfcs repo. That learns me for reviewing PRs first thing in the morning. |
This feels weird to me, but also pretty reasonable. Using the operators is overwhelmingly the convention. Having to branch specifically on Greater/Less/Equal is a very search-algorithm thing. This might become more common if/when we get some notion of comparators, but even then, most code will just pass the comparators around, not actually invoke them. |
I’ve always liked the fact that The Guide could be adjusted to demonstrate enums using a type that doesn’t already exist in the standard library (or at least in the prelude). It seems (to me) strange to change a very commonly-used part of the standard library based on a specific piece of documentation. |
Do the trait-based operators work without the trait in scope? Edit: actually that shouldn't matter. It's pretty common to have a T: Ord or T: Eq bound in generic code without actually using the associated enum (because you can just do <= or whatever). |
@P1start I see it as more 'the guide uncovering something that shouldn't always be there' than driven soley by the guide. |
I don't think this is very common compared to deriving it. And similar traits aren't, for example, |
I'm unsure how common this actually is, but it's true that I used |
I find it a little jarring to see first person pronouns in RFCs, because if you are just looking in the RFC repo itself, you may not know (or remember) who "I" refers to. But to address the question itself, I suspect that at first this was due to the influence of other languages, e.g. Haskell has
Well, I've used it for searches, merging sorted data structures while weeding out duplicates, custom Still, I admit that I don't see
|
Actually, thinking about it now, I'm not 100% sure what ops reform will do the the prelude, but I suppose that that's not relevant to this RFC... |
cc #503, an RFC for the entire prelude as well! |
Closing becuase #503 is better. 🎊 |
Remove
Ordering
and its variants from the prelude.rendered