Skip to content
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

Relation.Binary.Bundles.Preorder declares the 'wrong' symbol for the ordering relation!!! #2096

Closed
jamesmckinna opened this issue Sep 15, 2023 · 6 comments

Comments

@jamesmckinna
Copy link
Contributor

jamesmckinna commented Sep 15, 2023

Preorders are rarely Symmetric, unless they arise already from instances of Setoid/IsEquivalence.

So... why in the name of all that is holy do we declare them with a field name _∼_ which is (notationally/syntactically/formally) symmetric.

Consequences:

Refactoring PROPOSAL: that we rename (and appropriately deprecate, groan) the infix symbol/definition _∼_ to be _≲_, which becomes _≤_ in Poset, etc... and whose Relation.Binary.Properties.Preorder.InducedEquivalence be given by @laMudri 's Relation.Binary.Construct.Interior.Symmetric from #2071 applied to _≲_...

Just sayin'.

@laMudri
Copy link
Contributor

laMudri commented Sep 15, 2023

I agree that _∼_ is a bad name and plain old _≤_ would be much better. Unfortunately, I think this is inevitably a breaking change because of all the record { _∼_ = Leq }-like code which exists. At least the error message you get out of that should be somewhat instructive.

@Taneb
Copy link
Member

Taneb commented Sep 16, 2023

I agree that it's a breaking change. And I think that means if this is something we want to do, we ought to do it now. We're not going to have another major version increment any time soon

@jamesmckinna
Copy link
Contributor Author

Two/three things to say to this:

  • yes, as a major breaking change, I think it's important to do it sooner rather than later (thanks @Taneb !);
  • I'm nearly done with the corresponding one for negated symbols, [fixes #1214] Add negated ordering relation symbols systematically to Relation.Binary.* #2095 which exposed to me the larger problem concerning flipped symbols as a whole; out of sheer rage last night I started work on it, but rolled back before I went completely berserk, but a follow-up PR in the spirit of my current one would be... very desirable I think ;-)
  • regarding symbols, actually I think that there is value in distinguishing between the Preorder version of the symbol and the Poset version (and that there should be a third one by convention used for your Prosets @laMudri , I think, even if they never actually get materialised as Bundle in their own right...), and chose, somewhat arbitrarily, the one above. But it's a small(er) hill on which to die... perhaps.

@jamesmckinna
Copy link
Contributor Author

jamesmckinna commented Sep 16, 2023

Aaaargh... this may be worse than I hoped/thought/feared. Some great subtleties to do with renaming symbols in the signature of the module of a record, without being able to rename the corresponding defined field/method in a record in the record signature... as a result of which, exported sub-derived records retain the old definition name, even though they can be renamed on opening qua modules... blimey!

@jamesmckinna jamesmckinna changed the title Algebra.Bundles.Preorder declares the 'wrong' symbol for the ordering relation!!! Relation.Binary.Bundles.Preorder declares the 'wrong' symbol for the ordering relation!!! Sep 16, 2023
@JacquesCarette
Copy link
Contributor

Agree with changing to _≲_ now.

@jamesmckinna
Copy link
Contributor Author

jamesmckinna commented Oct 4, 2023

Closing this now after merge of #2099 . But NB discussion above about deprecation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants