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

First-class patterns, or, patterns-as-objects #49

Closed
ice1000 opened this issue Mar 4, 2021 · 6 comments · Fixed by #444
Closed

First-class patterns, or, patterns-as-objects #49

ice1000 opened this issue Mar 4, 2021 · 6 comments · Fixed by #444
Labels
invalid This doesn't seem right

Comments

@ice1000
Copy link
Member

ice1000 commented Mar 4, 2021

As title. I think this is an interesting idea, and I will discuss this with y'all in the next Walpurgis night.

@ice1000
Copy link
Member Author

ice1000 commented Mar 4, 2021

\struct Monoid
 | A : \Set
 | \pattern identity : A
 | \infix + (a b : A) : A \with {
  | identity, a => a
  | a, identity => a
 }

@ice1000
Copy link
Member Author

ice1000 commented Mar 4, 2021

I want pattern synonym to be a first-class citizen in the language. We need to have a type for them.

@ice1000
Copy link
Member Author

ice1000 commented Mar 4, 2021

\struct Monoid
 | A : \Set
 | \pattern identity (x : A) : A
 | \infix + (a b : A) : A \with {
  | identity x, a => a
  | a, identity x => a
 }

@ice1000
Copy link
Member Author

ice1000 commented Mar 29, 2021

We could start from 'pattern definitions':

\pat one : Nat => suc zero
\pat suc-suc-a (a : Nat) => suc (suc a)

\def a-2 (a : Nat) : Nat
 | suc-suc-a a => a
 | one => one
 | zero => zero

Note that I want to use \pat definitions as both patterns and functions.

@ice1000 ice1000 transferred this issue from aya-prover/aya-prover-proto Sep 28, 2021
@ice1000 ice1000 linked a pull request Aug 25, 2022 that will close this issue
@ice1000
Copy link
Member Author

ice1000 commented Aug 25, 2022

Deprecated

@ice1000 ice1000 closed this as completed Aug 25, 2022
@ice1000 ice1000 added the invalid This doesn't seem right label Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant