mirror of
https://github.com/sdiehl/write-you-a-haskell.git
synced 2024-09-17 14:37:16 +03:00
Merge pull request #40 from chsievers/fix_infer
poly: fix type inference
This commit is contained in:
commit
6c216e39de
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user