} else { return -1; }}}}}}}}}}
}
+toChar(x) :: Int -> Char{
+ if(x == 0){ return '0';
+ } else { if(x == 1){ return '1';
+ } else { if(x == 2){ return '2';
+ } else { if(x == 3){ return '3';
+ } else { if(x == 4){ return '4';
+ } else { if(x == 5){ return '5';
+ } else { if(x == 6){ return '6';
+ } else { if(x == 7){ return '7';
+ } else { if(x == 8){ return '8';
+ } else { if(x == 9){ return '9';
+ } else { return '0'; }}}}}}}}}}
+}
+
isDigit(x) :: Char -> Bool {
return toInt(x) != -1;
}
print("]\n");
}
+printInt(x) {
+ [Char] l = [];
+ while(x > 0){
+ l = toChar(x % 10) : l;
+ x = x / 10;
+ }
+ print(l);
+}
+
main(){
var num = "-1234";
- printList(print, 1 : 2 : []);
+ printList(printInt, 32 : 4 : []);
}
,Instr "ldc" [Lit 0] ""
,Instr "sth" [] ""
,Instr "ajs" [Lit -1] ""]
+ Nothing = liftT $ Left $ Error "PANIC: unresolver variable expr"
g (LambdaExpr _ _ _) = liftT $ Left $ Error "PANIC: Lambdas should be unfolded"
g (FunExpr _ k es fs) = funnyStuff k es fs