caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Question about type unification
@ 2008-05-26 12:22 Richard Jones
  2008-05-26 12:33 ` [Caml-list] " Jon Harrop
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Richard Jones @ 2008-05-26 12:22 UTC (permalink / raw)
  To: caml-list


With this definition:

  type 'a t = float

Why is this allowed?

  # ((3.0 : unit t) : string t) ;;
  - : string t = 3.

Note that unification is prevented if t is opaque, eg, hidden behind a
module signature.

Rich.

-- 
Richard Jones
Red Hat


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

end of thread, other threads:[~2008-05-26 21:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-26 12:22 Question about type unification Richard Jones
2008-05-26 12:33 ` [Caml-list] " Jon Harrop
2008-05-26 12:37 ` Romain Bardou
2008-05-26 17:21 ` Fabrice Marchant
2008-05-26 19:29   ` Robert Fischer
2008-05-26 19:38     ` DooMeeR
2008-05-26 19:43       ` Robert Fischer
2008-05-26 19:45     ` Jeremy Yallop
2008-05-26 21:44   ` Richard Jones

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).