mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Note a bug in unify.
This commit is contained in:
parent
9aa0ae2f32
commit
7802356d85
@ -30,5 +30,6 @@ unify (a1 :-> b1) (a2 :-> b2) = (:->) <$> unify a1 a2 <*> unify b1 b2
|
|||||||
unify (a1 :* b1) (a2 :* b2) = (:*) <$> unify a1 a2 <*> unify b1 b2
|
unify (a1 :* b1) (a2 :* b2) = (:*) <$> unify a1 a2 <*> unify b1 b2
|
||||||
unify (TVar _) b = pure b
|
unify (TVar _) b = pure b
|
||||||
unify a (TVar _) = pure a
|
unify a (TVar _) = pure a
|
||||||
|
-- FIXME: this can succeed incorrectly for lists of inequal length.
|
||||||
unify (TArr as) (TArr bs) = TArr <$> for (zip as bs) (uncurry unify)
|
unify (TArr as) (TArr bs) = TArr <$> for (zip as bs) (uncurry unify)
|
||||||
unify t1 t2 = fail ("cannot unify " ++ show t1 ++ " with " ++ show t2)
|
unify t1 t2 = fail ("cannot unify " ++ show t1 ++ " with " ++ show t2)
|
||||||
|
Loading…
Reference in New Issue
Block a user