case checking partially working

This commit is contained in:
2024-08-04 15:46:43 -07:00
parent 067a83960d
commit 09227e444a
11 changed files with 174 additions and 33 deletions

View File

@@ -4,5 +4,6 @@ nat : U
nat = {C : U} -> C -> (nat -> C) -> C
-- TESTCASE This was broken when I wasn't expanding Ref ty in check
-- Also broken when I tried to put Def in VRef
succ : nat -> nat
succ = \n => \ z s => s n

21
newt/testcase.newt Normal file
View File

@@ -0,0 +1,21 @@
module Scratch
data Nat : U where
Z : Nat
S : Nat -> Nat
data Vect : Nat -> U -> U where
Nil : {a : U} -> Vect Z a
Cons : {a : U} {n : Nat} -> a -> Vect n a -> Vect (S n) a
plus : Nat -> Nat -> Nat
plus = \ n m => case n of
Z => m
S k => S (plus k m)
length : {a : U} {n : Nat} -> Vect n a -> Nat
length = \ v => case v of
Nil => Z
Cons x xs => S (length {a} xs)