lean4-htt/tests/lean/run/1216.lean
Leonardo de Moura 87932f1c56 feat(frontends/lean): change notation for inaccessible patterns
The following are accepted
 .(t)
 ._

We don't accept .t anymore because it will conflict with the field
access notation.
2017-03-28 16:09:15 -07:00

23 lines
737 B
Text
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

open nat
inductive {u} Vec (X : Type u) : → Type u
| nil {} : Vec 0
| cons : X → Pi {n : nat}, Vec n → Vec (n + 1)
namespace Vec
def get₂ {A : Type} : Π {n : }, Vec A (succ $ succ n) → A
| n (cons x₁ (cons x₂ xs)) := x₂
def get₂a {A : Type} : Π {n : }, Vec A (n+2) → A
| 0 (cons x₁ (cons x₂ xs)) := x₂
| (n+1) (cons x₁ (cons x₂ xs)) := x₂
def get₂b {A : Type} : Π {n : }, Vec A (n+2) → A
| n (cons x₁ (cons x₂ xs)) := x₂
def get₂c {A : Type} : Π {n : }, Vec A (n+2) → A
| .(n) (@cons .(A) x₁ .(n+1) (@cons .(A) x₂ n xs)) := x₂
def get₂d {A : Type} : Π {n : }, Vec A (n+2) → A
| .(n) (@cons .(A) x₁ (n+1) (@cons .(A) x₂ .(n) xs)) := x₂
end Vec