| length dups > 0 = Left ["Duplicate functions: ":[toString n\\[(Function n _ _):_]<-dups]]
= case partition (\a->a=:(Function ['start'] _ _)) fs of
([], _) = Left ["No start function defined"]
- ([Function _ [] e:_], fs) = (\x->(e, x)) <$> runInfer (infer (fromList builtin) $ makeExpression fs e)
+ ([Function _ [] e:_], fs)
+ # e = makeExpression fs e
+ = (\x->(e, x)) <$> runInfer (infer (fromList builtin) e)
([Function _ _ _:_], _) = Left ["Start cannot have arguments"]
makeExpression :: [Function] Expression -> Expression
+ ifxl 6 = code add;
on f g a b = f (g a) (g b);
-onn = \f. \g. \a. \b. f (g a) (g b);
//Conditional operators
if = code if;
-//fac i = if (i == 0) 1 $ i * fac (i - 1);
+fac i = if (i == 0) 1 $ i * fac (i - 1);
id x = x;
even i = if (i == 0) True (odd (i - 1));
odd i = if (i == 0) False (even (i - 1));
-
-//start = on;
-start = ($) id 42;