-
Notifications
You must be signed in to change notification settings - Fork 242
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
Drop equivalence relation from Algebra.Bundles.Raw
structures?
#2506
Comments
We're using the |
Why are these part of the structures as opposed to being parameters of homomorphism? |
Thanks @carlostome for the (challenging!) questions. I hope the rambling discussion below helps... I'd make two observations before going away to try to think a bit harder about this (and probably nudge @JacquesCarette and @MatthewDaggitt for comment...):
For better or worse (and certainly, pre the development of HoTT/cubical ideas around making equality a global/ambient property of types), The (not an exact one, though!) analogy from universal algebra (I think! UA experts please correct me if not) is whether or not equality is taken as explicit part of the relational signature, or presupposed. Making equality part of the The 'dirty' reason underlying such a choice is precisely (?) to avoid marshalling and unmarshalling an explicit Lastly, I'm always reluctant to take too seriously any comparison with haskell typeclasses, precisely because, by not having to take laws seriously, they avoid all the hard work in figuring out a workable design for 'real' algebraic structure (never mind the compromises entailed by having type-checking based on (unique) instance inference...) |
Under propositions-as-types, I'd be tempted to go out on a limb and say that the 'operational signature' ('syntax') of an algebra includes/should include the 'relational signature', since together they define the language in which the equations ('semantics') can be stated as properties expressed relative to such a vocabulary... but that's probably a reach too far, philosophically at least? After all, the ordered structures under TL;DR: I think the orthodox first-order model theory distinction between function symbols and relations is artificial, just as is that between 'expressions' and 'terms' as to well-formedness wrt a possibly non-context-free grammar. |
And... finally: what would we do if we went beyond purely first-order algebraic signatures to essentially algebraic, where equality plays a role in even defining well-formedness of terms (eg specifying pullbacks as a 'function' of conical data)? |
My feeling is that, yes, there is a possible argument for removing the equality parameter from the raw bundles, but that in practice to do so would be an unavoidably huge breaking change. As has been mentioned by @jamesmckinna passing the equalities as arguments would also result in extra friction so the motivation for doing so would have to be strong. Is there something that you concretely can't do with the current setup? |
There are indeed multiple coherent designs here. The current one seems to be a rather good compromise between an ideal design (that would make as many things as possible independent) and one that works with "today's Agda". @jamesmckinna lays out the possibilities quite well. I don't think that just dropping these equivalence relations would land us at a 'better' design (and certainly would break tons of code). I think a 'better' design that the current one would require significantly more changes [and some Agda support.] |
@carlostome would you prefer to keep this open, or can/should we close now, against the possibility of re-opening in the future? |
Thanks everyone for the enlightening replies. After reading through the comments, I realize that including the equality relation aligns best with the overall organization of the standard library around I think we can close the issue. |
@carlostome writes:
I do too, but it (and most importantly, the discussion above!) will happily remain part of the (long, and hopefully eventually, storied) history of Thanks for your question and thoughtful response to our feedback, |
Structures currently defined in
Algebra.Bundles.Raw
(RawMagma
,RawMonoid
,...) include as part of their definitions the "underlying equality" relation. For example,The rationale behind
Raw
structures (cf.README.Design.Hierarchies
) seems to be that they ought to only bundle algebraic operations (e.g._∙_ : Op₂ Carrier
above) in a spirit similar to Haskell's typeclasses.Wouldn't it make sense to drop the
_≈_
relation from these structures?As a point of comparison, the
Raw
structure for functor does not include such relation (Effect.Functor
):The text was updated successfully, but these errors were encountered: