caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* covariance newb question
@ 2005-11-22 11:37 Christophe Papazian
  2005-11-23 12:16 ` [Caml-list] " Keiko Nakata
  2005-11-27 23:31 ` Christophe Raffalli
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe Papazian @ 2005-11-22 11:37 UTC (permalink / raw)
  To: caml-list

# type +'a t = 'a -> 'a;;
In this definition, expected parameter variances are not satisfied.
The 1st type parameter was expected to be covariant, but it is invariant


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>

Is there something wrong in my thought ?

thank you,

	Christophe Papazian


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-28  7:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-22 11:37 covariance newb question Christophe Papazian
2005-11-23 12:16 ` [Caml-list] " Keiko Nakata
2005-11-27 23:31 ` Christophe Raffalli
2005-11-28  7:09   ` Olivier Andrieu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).