(Type u) is the old (Type (u+1)) (PType u) is the old (Type u) Type* is the old (Type (_+1)) PType* is the old Type* The stdlib can be compiled, but we still have > 70 broken tests See discussion at #1341
23 lines
723 B
Text
23 lines
723 B
Text
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
|