Skip to content

[ breaking ] change fieldname _≟_ to _≈?_ in IsDecEquivalence#2952

Open
jamesmckinna wants to merge 21 commits intoagda:masterfrom
jamesmckinna:issue2845
Open

[ breaking ] change fieldname _≟_ to _≈?_ in IsDecEquivalence#2952
jamesmckinna wants to merge 21 commits intoagda:masterfrom
jamesmckinna:issue2845

Conversation

@jamesmckinna
Copy link
Collaborator

@jamesmckinna jamesmckinna commented Feb 25, 2026

This tackles the name change discussed in #2845 , plus a lot of knock-ons for consistency's sake.

I've tagged it breaking, even though I think I've caught all the possible deprecations, because we change a fieldname. But maybe it's 'just' a non-backwards compatible change... ??? It seems as though it would be good to try to do this for v2.4, but perhaps it must wait for v3.0.

No CHANGELOG yet as a consequence... but style-guide updated.

UPDATED: now there are CHANGELOG entries, but I just can't face writing out the deprecations for every module touched, so some kind of summary paragraph would (probably) be better. Plus: some of the 'deprecations' are for lemmas introduced in earlier v2.4 PRs, so I may well not have things quite right... yet.

NB.

  • there are v1.3/v1.5-era deprecations which remind us we've been round this merry-go-round before. Sigh.
  • under Algebra.Solver, I've also corrected the fixity of the defined DecidableEquality on Normal forms from 5 to 4, but I hope that this is harmless!
  • I have not attempted to rename any of the 'other' combinators used along the way (eg. Relation.Binary.Construct.Intersection.decidable as discussed in Use consistent names for Decidable combinators (#2842 redux) #2846 )

@jamesmckinna jamesmckinna marked this pull request as draft February 25, 2026 08:12
@jamesmckinna jamesmckinna added this to the v2.4 milestone Feb 25, 2026
@jamesmckinna jamesmckinna linked an issue Feb 25, 2026 that may be closed by this pull request
@jamesmckinna jamesmckinna marked this pull request as ready for review February 25, 2026 12:28
Comment on lines +114 to +115
≡?-≡-refl : (i : Fin n) → (i ≡? i) ≡ yes refl
≡?-≡-refl _ = ≡?-≡ refl
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given all the new deprecations, there is an additional opportunity here to reconcile the inconsistent naming between Fin and Nat of this and other properties, but that may be too much additional weight for this PR to carry.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be in favour of doing this sort of thing in this PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we need to agree on our preferred name, and I can't quite remember where we last discussed this! Maybe git blame is the answer...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So... #2740 seems to establish the names in Data.Fin.Properties as canon/ical, with the names for Nat being legacy and up for renaming+deprecation... so let's try to do this here!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check my recent commits carefully: I think that I've got the names, and the CHANGELOG correct, given that the last round of names were also part of v2.4!!!

Comment on lines +72 to +76
_≟_ = _≈?_
{-# WARNING_ON_USAGE _≟_
"Warning: _≟_ was deprecated in v2.4.
Please use _≈?_ instead. "
#-}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed that this was the best way to keep the 'old' name around, but it does then entail some gymnastics in order to ensure that deprecated name is nevertheless correctly exported everywhere. Hopefully it all works in a non-breaking way!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB as usual, the warning doesn't seem to fire correctly in client modules...

open IsDecPreorder isDecPreorder public
using (module Eq)

open Eq public using (_≟_)
Copy link
Collaborator Author

@jamesmckinna jamesmckinna Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This being an example of the need to re-export, in spite of the deprecation.
So perhaps this should have additional commentary to mark it for deprecation... later

Comment on lines 48 to 50
infix 4 _≟-Lit_ _≟-Name_ _≟-Meta_ _≟-Visibility_ _≟-Relevance_ _≟-Arg-info_
_≟-Pattern_ _≟-ArgPatterns_

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hated modifying this whole block of v1.3-era deprecations, but hopefully once we remove them completely, this will all have been just a bad dream...

; pat-lit-injective to lit-injective
; _-Patterns_ to _≟s_
; _-Pattern_ to __
; _≡?-Patterns_ to _≟s_
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this renaming also be brought in line with the rest of the PR? AFAICT, this module ought perhaps to be stripped out in favour of the 'new' refactoring of the Reflection API under Reflection.AST.Term but I didn't want to break something which was already fixed, or vice versa!

It would be good if someone had another look at what's going on here...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never really dug into any parts of Reflection, so I can't really say. This one line does rather stick out now.

@jamesmckinna
Copy link
Collaborator Author

Ugh. I didn't catch them all, esp. under Data.*. Sigh.

@MatthewDaggitt
Copy link
Collaborator

While I agree this should be done, this is unavoidably a breaking change as you need to change how you define the IsDecEquivalence record. Furthermore, as can be seen by the number of knock on changes, this is a pretty massive breaking change.

Therefore according to our backwards compatibility policy, this definitely needs to be v3.0 not v2.4.

@MatthewDaggitt MatthewDaggitt modified the milestones: v2.4, v3.0 Mar 3, 2026
Copy link
Collaborator

@JacquesCarette JacquesCarette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tediousness of this PR, coupled with the fact that a handful of times in 188, really non-trivial decisions had to be made, made reviewing quite something.

I did not see anything that seemed incorrect.

@jamesmckinna
Copy link
Collaborator Author

jamesmckinna commented Mar 3, 2026

I agree with @MatthewDaggitt 's analysis, so I do now wonder whether the 'simpler' PRs hanging off this one (such as #2955 , just merged) maybe ought to be paused, or should we carry on with migrating to the X? style?

And, given that it's moving to v3.0, I'll try to lift out a CHANGELOG patch so that it can be re-applied once that's reset for the post-v2.4 dev cycle...

@jamesmckinna
Copy link
Collaborator Author

jamesmckinna commented Mar 3, 2026

The tediousness of this PR, coupled with the fact that a handful of times in 188, really non-trivial decisions had to be made, made reviewing quite something.

I did not see anything that seemed incorrect.

Thanks for you patience @JacquesCarette ! It was pretty tedious to do, esp. as many many changes were not flagged as necessary by generating deprecation warnings... and yes, the few non-trivial changes, some of which being 'tricky' (under Reflection) make the whole thing quite painful.

But maybe if we go wholesale for breaking v3.0 version, then we can try to be less accommodating wrt deprecations?

UPDATED: @JacquesCarette reading your recent comments on LLM-generated content, apologies for making this PR harder to review than to write... but begging indulgence, on my own behalf, if nothing else ;-)

@JacquesCarette
Copy link
Collaborator

Re-running the one failed job as it seemed like a temporary hiccup.

And no worries @jamesmckinna : I accept the burden of being an Open Source maintainer willingly. And that includes sometimes reviewing tedious but important PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

What name should we use for (instances of) DecidableEquality?

5 participants