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

Make _⋆_, _∘_ right associative in Category #643

Closed
barrettj12 opened this issue Nov 22, 2021 · 2 comments · Fixed by #665
Closed

Make _⋆_, _∘_ right associative in Category #643

barrettj12 opened this issue Nov 22, 2021 · 2 comments · Fixed by #665

Comments

@barrettj12
Copy link
Contributor

So that we can write

f ⋆ g ⋆ h

and Agda will know how to parse it.

It's as easy as putting

  infixr 9 _⋆_
  infixr 9 _∘_

at the end of the definition of Category.

We could also think about doing this for other associative algebraic structures (semigroups, groups, rings, ...)

@felixwellen
Copy link
Collaborator

felixwellen commented Nov 23, 2021

We already use infixr for + in AbGroup. And we use infixl for a whole lot of operations in algebraic structures. I haven't thought about which one might be better...

And I can't see a reason why we shouldn't use this for categories.

@barrettj12
Copy link
Contributor Author

Considering we have associativity, I don't think it matters too much whether we choose infixl or infixr. I just copied the infixr 9 _∘_ declaration from Cubical.Foundations.Function. Right associativity seems to be conventional.

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

Successfully merging a pull request may close this issue.

2 participants