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

As-pattern for and within implicit arguments #2411

Closed
jonaprieto opened this issue Sep 28, 2023 · 1 comment
Closed

As-pattern for and within implicit arguments #2411

jonaprieto opened this issue Sep 28, 2023 · 1 comment
Labels
wontfix This will not be worked on

Comments

@jonaprieto
Copy link
Collaborator

The formatter (v0.5.1-dev) changes as-patterns as in the following example.

a : {A : Type} → A × Nat → Nat
-  | {A'@_} p@(x, s@zero) := snd p + 1
+  | A'@{_} p@(x, s@zero) := snd p + 1
  | p@(x, s@_) := snd p + 1;

While the change breaks the code atm, I think this is fine, i.e.,
an implicit pattern expression can be named in the following way.

f : {x : _} -> ...:=
  | y@{_} := ...;

One may need to name inner patterns as well, so the following should be also
permitted.

f : {x : Ind} -> ...:=
  | ...
  | y@{cons1 x1 z@(cons x2 xs)} := ...;
@jonaprieto jonaprieto added wontfix This will not be worked on and removed pending-review labels Nov 3, 2023
@jonaprieto
Copy link
Collaborator Author

The change done by the formatter in v0.5.1 was a bug, recently fixed by #2486. We are not interested in changing its syntax in the short term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant