-
Notifications
You must be signed in to change notification settings - Fork 371
Hidden argument puns #6325
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
Comments
With |
I only intended this change to affect left-hand side binders. |
So, should And what if my variable name clashes with a constructor? open import Agda.Builtin.Nat
foo : {zero : Nat} -> Nat
foo {zero} = 43 |
Do you want Agda to reject
Good point. When you expand |
I think it should also be possible to have instance argument puns, so I suggest that the flag is called
I've changed my mind. The pattern |
I modified a previous version of the commit after feedback from Andreas Abel.
I modified a previous version of the commit after feedback from Andreas Abel.
@nad: Anything left to be done here for 2.6.4? |
I don't think so. |
I modified a previous version of the commit after feedback from Andreas Abel.
Recently I wrote the following code:
I have lots of code of this highly redundant form. I could perhaps use positional matching for some of the arguments, but with generalisable variables it might not be clear in what order the arguments appear, and perhaps the order changes if Agda's unification algorithm changes.
I would like to be able to write the following instead:
I suggest that we add a flag called something like
--implicit-argument-puns
(the name is based on GHC's featureNamedFieldPuns
). If that flag is used, then{x}
in a binding position means{x = x}
.In analogy with GHC's record wildcards one might also consider supporting something like
{…}
, where this would mean, roughly, "{x}
for each implicit argumentx
that has not been explicitly bound". However, I don't want to mix scope-checking and type-checking, so I do not suggest that we should implement this.The text was updated successfully, but these errors were encountered: