[nem-en] subtyping of -> and tuples

Michal Moskal michal.moskal at gmail.com
Fri Jun 15 11:47:28 CEST 2007


On 6/15/07, Kamil Dworakowski <kamil.dworakowski at googlemail.com> wrote:
> 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) })

Because there is no runtime subtyping in the underlaying .NET VM.
We've tried to provide implicit conversions, but it doesn't always
work.

-- 
   Michał


More information about the devel-en mailing list