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

Support Absurd Patterns #43

Open
CodaFi opened this issue Nov 28, 2017 · 0 comments
Open

Support Absurd Patterns #43

CodaFi opened this issue Nov 28, 2017 · 0 comments

Comments

@CodaFi
Copy link
Member

CodaFi commented Nov 28, 2017

Sema is aware of absurd patterns, which allow one to omit the body of a function when pattern clauses cause contradictions.

proj : forall {n : N} {X : Type} → Vec X n → Fin n → X
proj [] ()
proj (cons x xs) zero = x
proj (cons x xs) (suc i) = proj xs i

The syntax for this needs to be added to the grammar and to the parser. Scope check need not concern itself with whether performing an inversion on the parameter will introduce a contradiction, it just needs to lower down to an empty Clause.Body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant