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

Avoid unnecessary syntax declarations #1038

Merged
merged 2 commits into from
Sep 10, 2023

Conversation

MatthiasHu
Copy link
Contributor

@MatthiasHu MatthiasHu commented Aug 29, 2023

This PR replaces syntax declarations which

  • do not bind variables and
  • do not change the order of arguments in such a way that some argument depends on some later argument

by ordinary infix (or mixfix) operator declarations.

The motivation for avoiding syntax declarations is that Agdas behavior around them can be confusing, for example:

  • "jumping to the definition" of a declared syntax does not jump to the syntax declaration but to the definition of the name it stands for.
  • When you type an operator that is actually a declared syntax, like _⇒_ (from NaturalTransformation.Base), in a hole and ask for its type (or try to "refine", or "give" the hole), you get a "Not in scope" error. (If I understand correctly, _⇒_ does indeed not exist as a name. But it is easy to expect it to exist.)
  • If you want to import a declared syntax by open ... using (...), you have to write the name it refers to, even though you then never use that name.

@MatthiasHu
Copy link
Contributor Author

Are there any advantages of syntax declarations that I might be missing? (Let me ping @mzeuner just because you wrote the ones for ∘a and ∘r :-) )

@MatthiasHu MatthiasHu marked this pull request as ready for review August 29, 2023 16:47
@felixwellen felixwellen self-assigned this Sep 10, 2023
@felixwellen
Copy link
Collaborator

For the slim chance that there is such an advantage, we can still revert -> merging.

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 this pull request may close these issues.

None yet

2 participants