new tag syntax; preparing for Core patterns

new tag syntax; preparing for data names
This commit is contained in:
crumbtoo
2024-01-24 11:30:34 -07:00
parent d52a366c1b
commit 170e4e36ae
8 changed files with 42 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
fac n = case (==#) n 0 of
{ 1 -> 1
; 0 -> (*#) n (fac ((-#) n 1))
{ <1> -> 1
; <0> -> (*#) n (fac ((-#) n 1))
};
main = fac 3;

View File

@@ -2,8 +2,8 @@ nil = Pack{0 0};
cons x y = Pack{1 2} x y;
list = cons 1 (cons 2 (cons 3 nil));
sum l = case l of
{ 0 -> 0
; 1 x xs -> (+#) x (sum xs)
{ <0> -> 0
; <1> x xs -> (+#) x (sum xs)
};
main = sum list;