= case partition (\a->a=:(Function ['start'] _ _)) fs of
([], _) = Left ["No start function defined"]
([Function _ [] e], fs)
- # e = foldr (\(Function i a e)->Let i (foldr ((o) o Lambda) id a e)) e fs
+ # e = foldr (\(Function i a e)->Let [(i, (foldr ((o) o Lambda) id a e))]) e fs
= (\x->(e, x)) <$> runInfer (infer preamble e)
([Function _ _ _], _) = Left ["Start cannot have arguments"]
// = infer env e1
// >>= \(s1, t1)->infer ('Data.Map'.put x (generalize (apply s1 env) t1) env) e2
// >>= \(s2, t2)->pure (s1 oo s2, t2)
-infer env (Let x e1 e2)
+infer env (Let [(x, e1)] e2)
= fresh
>>= \tv-> infer ('Data.Map'.put x (Forall [] tv) env) e1
>>= \(s1, t1)->infer ('Data.Map'.put x (generalize (apply s1 env) t1) env) e2