Merge pull request #40 from chsievers/fix_infer

poly: fix type inference
This commit is contained in:
Stephen Diehl 2015-01-21 09:21:03 -05:00
commit 6c216e39de

View File

@ -178,7 +178,7 @@ inferPrim :: TypeEnv -> [Expr] -> Type -> Infer (Subst, Type)
inferPrim env l t = do
tv <- fresh
(s1, tf) <- foldM inferStep (nullSubst, id) l
s2 <- unify (tf tv) t
s2 <- unify (apply s1 (tf tv)) t
return (s2 `compose` s1, apply s2 tv)
where inferStep (s, tf) exp = do