-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add support for partial ordering to Comparators #5771
Comments
Pavel Marek reports a new STANDUP for today (2023-02-27): Progress: Reverting back the functionality of comparators such that partial ordering is supported. Reformating every related builtin node such that it can take |
Why don't we have just a single:
Such an API is simpler and achieves the same. Everyone who would want to support just |
Now that we support partial ordering, and we can have situations like:
i.e. These all changes of course mean that we will have to deal with more weird comparator behavior at runtime, but since we all agreed that our users are as clueless as possible, then I think these changes are just fine. The author of the proposal to differentiate between ordered and unordered comparators is @radeusgd, so if he does not have any strong opinions against merging ordered and unordered comparators into single comparators, then let's do it. |
Have I made an oversight in the previous comment? I am surprised
Don't we want all Enso objects to participate in (hash) |
You are right. We can, and probably should, enforce users to specify By the way, let's deal with the merging of unordered and ordered comparators into a single one in a separate issue. |
I think with the new approach merging these two seems fine. My only concern is that is may be relatively common for users to want to define such unordered types and having to define a BUT I don't think this is an issue, because we should be able to, at the library level, provide a helper So I think at implementation level it is all good, and at the user-facing API level we may want to revise it later on, probably ideally once we use custom comparators a bit more and see what patterns will work best. |
Pavel Marek reports a new STANDUP for yesterday (2023-02-28): Progress: Refactoring code base such that |
Pavel Marek reports a new STANDUP for yesterday (2023-02-28): Progress: Use |
Pavel Marek reports a new STANDUP for today (2023-03-02): Progress: Trying to fix some issues in my config that arised after Hubert's PR - sbt |
Pavel Marek reports a new 🔴 DELAY for yesterday (2023-03-06): Summary: There is 3 days delay in implementation of the Add support for partial ordering to Comparators (#5771) task. Delay Cause: Taking into account my 1 day off on Friday. |
Pavel Marek reports a new STANDUP for yesterday (2023-03-06): Progress: Integrating review comments. Discussion about sorting and how to treat incomparable values. Fixing some tests. It should be finished by 2023-03-06. |
After recent discussion with @JaroslavTulach and @radeusgd (the conclusion is here #5742 (comment)) we have decided that we will roll back the behavior of comparators to allow specification of partial ordering. The new API shall look like so:
for
compare x y
, the return value ofNothing
specifies thatx
andy
are incomparable. (for example, this will be the case whenx
ory
isNaN
).Tasks
The text was updated successfully, but these errors were encountered: