-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
max is not stable for preorders #8825
Comments
"Wrong" is too strong a statement: I changed the title of this issue to reflect your primary concern. |
These seem like good identities to respect, but I agree, calling this wrong is too strong. |
Agreed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a preorder,
min
of two equivalent elements should return the first parameter, andmax
should return the second. This makes the following properties true:(min(x,y), max(x,y))
is either(x,y)
or(y,x)
;(x,y)->(min(x,y), max(x,y))
is a stable sort.The definition of
max
at operators.jl:56 is wrong — it returns the first argument for equivalent arguments:You'll find a more detailed discussion in Chapter 7 of https://www.stepanovpapers.com/notes.pdf .
The text was updated successfully, but these errors were encountered: