-
Notifications
You must be signed in to change notification settings - Fork 246
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
[DRY] why is _≉_
defined both for Algebra.Bundles.Raw.RawX
bundles, and via Setoid
instances, for Algebra.Bundles.X
?
#2274
Comments
In the absence of further discussion yet, note there are two possible scenarios:
I'm not sure what the official (universal algebra) nomenclature is for each kind, but on the model of the theory of formal systems, I supposed the first should be called 'derivable', while the second 'admissible'? In any case, this issue concerns derivable operations being defined 'too late' to be exported to any subsequently definable extension of the algebra. And that does seem to be a DRY problem... over and above the 'where should such things live?' question... |
Finally catching up on really old stuff - my mailbox is quite full of saved email about items that I meant to comment on. Still have 30 or so from 2024 alone, never mind a whole bunch from 2023! I do agree that the library is over-eager to define 'helper' conservative extensions that turn out to be seldom used. (I don't know what the official nomenclature is either, but 'derivable' and 'admissible' make a lot of sense.) I'm a bit concerned about solving DRY problems by over-defining things just on the off chance they might be needed. (Especially here as negation is so so often a code smell in constructive mathematics.) Personally I'd prefer some 'helper' module(s) [with a better name than Helper !] that define extensions in a standard way. I've migrate things towards that in |
@JacquesCarette thanks for returning to this! And I appreciate you separating out two parts to this:
But here the problem is that, independent of any answer to the first, the second is answered in weird/bad/DRY-violating ways. So from my point of view it's not a case of being "over-eager", except inasmuch as contributors have not been clear what to add where, so have ended up duplicating structure... and in the case of As to the first, I'm a bit 'wider' than you as regards extending So a resolution of this issue for me would happily resolve the first question in whatever form (we should reach agreement... either as an 'extension' module, or as 'batteries included', and if so, how much?), but first how we consider appropriate to resolve/standardise the second... |
As for ... but your point about it being a code smell is an interesting one. Barring eg it's 'general' properties wrt ... so a possible 'better' place to add it would/might be as a manifest field of |
Through the many many words, talking about many fascinating issues... I've lost the thread about what is the main issue at stake here? |
My view is that really the correct solution is number 1. It should be in the |
Yup, that's my weakness... (too) "many many words" ;-) TL;DR: there are 2 issues at stake:
In each case, the solution would (seem to) be a fiddly (and possibly, for the |
|
@Taneb yup, all the various ordering relations and their flipped- and negated- versions should be in |
Looping back to @JacquesCarette 's comment above, in the light of #2491
I think that perhaps, along the 'minimalist'/'maximalist' spectrum of |
While working on #2491 I had hoped that So @JacquesCarette 's general point about 'helper' modules actually seems to suggest that we should prefer option 2 in the original proposal above, because the 'helper module' associated with an |
Depending on what you mean by vocabulary, I've moved some of that out too -- see the sub-module I used to think that defining all sorts of helper stuff early and 'globally' was a great idea, as I thought that this had low 'weight'. Turns out this is not true in current Agda (but could be a deficiency?) So I've moved to pulling these out, at least in the worst offenders. |
Thanks @JacquesCarette I think that Matthew has commented elsewhere as to the excess 'weight' of adding properties to |
Coming back to this: adding some small amount of very standard vocabulary might make sense. We'd have to have guidelines. And yes, vocabulary is different than properties. I was just shocked by how much "standard vocabulary" came with a Monoidal Category -- and how much that bloated things downstream. |
Unfortunately I get the feeling that the issue outlined here isn't quite all resolved (yet). If nothing else, there's some design to document. |
Thanks @JacquesCarette . I think that there are two things to do to resolve the [ DRY ] aspect, and separately, to leave this issue open regarding the wider question of the minimal/maximal 'basic' API for
Regarding the second, I think this can be done with a minimally invasive PR, in preparation now: #2536 |
Yes, I do think that that PR does the job. See additional comments there. |
This is another instance of the issues arising when adding 'derived forms' to a(n algebraic) structure/bundle, namely where should they be added:
RawX
bundle? this is currently the case for_≉_
, but AFAICT, never used, except to hereditarily be re-exported to richer structures;IsX
structure? this is not currently the case for_≉_
via anIsEquivalence
field, but is forIsGroup._-_
cf. Add new operations (cf.RawQuasigroup
) toIsGroup
#2251 ;X
bundle? this is also the case for_≉_
via thesetoid
manifest field ([fixes #1214] Add negated ordering relation symbols systematically toRelation.Binary.*
#2095 , Added remaining flipped and negated relations to binary relation bundles #2162 ), when that is in fact a 'derived form' defined in theIsX
structure... and by the opening of the underlyingRawX
bundle.The first and third cases seem to me to represent a clear DRY violation, and probably arise from the accumulation of 'legacy' design decisions. But what, if any, should be our refactoring policy towards a revised design?
Context: I'm working on a branch/PR addressing #2273 and find myself wondering whether
(Raw)SuccessorSet
needs explicitly to declare a negated equality symbol, when it should be (available to be) brought into scope via theSetoid
instance ofIsSuccessorSet
...UPDATED I've tried to regularise my vocabulary to avoid speaking of 'instance's of
record
types in favour of referring to their (often alsorecord
-typed`) fields, also often manifest, ie. defined rather than declared.The text was updated successfully, but these errors were encountered: