fixes to pattern matching and codegen, J example works now

This commit is contained in:
2024-09-13 21:15:57 -07:00
parent 49c1f0ce5d
commit 33015dd060
5 changed files with 49 additions and 17 deletions

View File

@@ -10,3 +10,15 @@ sym Refl = Refl
trans : {A : U} {x y z : A} -> Eq x y -> Eq y z -> Eq x z
trans Refl Refl = Refl
coerce : {A B : U} -> Eq A B -> A -> B
coerce Refl a = a
J : {A : U} ->
{C : (x y : A) -> Eq x y -> U} ->
(c : (x : _) -> C x x Refl) ->
(x y : A) ->
(p : Eq x y) ->
C x y p
-- this was failing until I constrained scrutinee to the constructor + args
J c x y Refl = c x