Fixed inference with typed functions
[cc1516.git] / examples / higher.spl
index 0cd83de..1237743 100644 (file)
@@ -37,12 +37,12 @@ intList(x){
 }
 
 printIntList(l) :: [Int] -> Void{
-       print('[');
+    print('[');
        if(!isEmpty(l)){
                print(l.hd);
                l = l.tl;
        }
-       while(isEmpty(l)){
+       while(!isEmpty(l)){
                print(", ", l.hd);
                l = l.tl;
        }
@@ -54,4 +54,5 @@ main(){
        print("sum of 1..5 is: ", foldr(\x y->x+y, 0, intList(5)));
        print("filter evens from 0..12 is: ");
        printIntList(filter(\x->x%2 == 0, intList(12)));
+    printIntList(1:2:3:[]);
 }