X-Git-Url: https://git.martlubbers.net/?a=blobdiff_plain;f=examples%2FcodeGen.spl;h=77b02a1235fb6a5564b43b30f352c7fb3222c370;hb=c5e89ecf06145895bd8c8bca19e7e0587cfe1082;hp=ebede23fb7ac9fabfc66b997573cf08522c0d0d6;hpb=f081c2c5e248331eb6e2f090f4afe818fd8259eb;p=cc1516.git diff --git a/examples/codeGen.spl b/examples/codeGen.spl index ebede23..77b02a1 100644 --- a/examples/codeGen.spl +++ b/examples/codeGen.spl @@ -27,10 +27,18 @@ isE(x) :: [a] -> Bool { } main() { - [Int] x1 = 1 : 2 : []; - [Int] x2 = 0 : x1; - [Int] x3 = []; - //Bool y1 = isEmpty(x2); //gives weird type error, not sure why - isEmpty(x2); + // [Int] x2 = 0 : x1; + // [Int] x3 = []; + // (Int, Bool) x4 = (4, True); + // //Bool y1 = isEmpty(x2); //gives weird type error, not sure why +// isEmpty(x2); + [Int] x1 = 8 : 2 : []; + (Bool, Int) z = (True, 2); + var y = z.fst; + var x = (True, 5) : (False,0) : []; + var sdaf = isE(x1); + var z = isEmpty(x1); + Char c = read(); + x.hd.snd = 8; return; }