Kamil Dworakowski
2007-06-15 09:37:31 UTC
Why there is no subtyping for -> and tuples?
code from MType.Require:
| (Fun (f1, t1), Fun (f2, t2)) =>
// f2.Require (f1) && t1.Require (t2)
f1.Unify (f2) && t1.Unify (t2)
| (Tuple (l1), Tuple (l2))
when List.Length (l1) == List.Length (l2) =>
List.ForAll2 (l1, l2, fun (x : TyVar, y : TyVar) { x.Unify (y) })
-- Kamil Dworakowski
code from MType.Require:
| (Fun (f1, t1), Fun (f2, t2)) =>
// f2.Require (f1) && t1.Require (t2)
f1.Unify (f2) && t1.Unify (t2)
| (Tuple (l1), Tuple (l2))
when List.Length (l1) == List.Length (l2) =>
List.ForAll2 (l1, l2, fun (x : TyVar, y : TyVar) { x.Unify (y) })
-- Kamil Dworakowski