Version française
Home     About     Download     Resources     Contact us    
Browse thread
covariance newb question
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Keiko Nakata <keiko@k...>
Subject: Re: [Caml-list] covariance newb question
From: Christophe Papazian <christophe.papazian@gmail.com>
> But type t seems to be covariant :
> 
> # let f : 'a t = (fun x -> x);;
> val f : 'a t = <fun>
> # let g : int t = f;;
> val g : int t = <fun>

To my understanding, 
this is an instantiation of the type variable 'a to int,
not subtyping.

Hope this helps.

Keiko NAKATA