Files
newt/tests/black/CaseEval.newt
Steve Dunham 6baee23a73 addZero now works
distinguish two modes of unification
while pattern matching we return constraints on variables, and normally
we are more aggressive about evaluating when matching against a variable.
fixes to `let`
surface #check in vscode
2024-11-02 18:23:46 -08:00

22 lines
388 B
Agda

module CaseEval
data Nat : U where
Z : Nat
S : Nat -> Nat
plus : Nat -> Nat -> Nat
plus Z y = y
plus (S x) y = S (plus x y)
data Eq : {A : U} -> A -> A -> U where
Refl : {A : U} -> {x : A} -> Eq x x
two : Eq (plus (S Z) (S Z)) (S (S Z))
two = Refl
three : Eq (plus (S Z) (S (S Z))) (plus (S (S Z)) (S Z))
three = Refl
addZero : {n : Nat} -> Eq (plus Z n) n
addZero {n} = Refl