caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Another polymorphism puzzle
@ 2005-04-01  2:02 Yaron Minsky
  2005-04-01  2:32 ` [Caml-list] " Karl Zilles
  2005-04-01  2:52 ` Manos Renieris
  0 siblings, 2 replies; 5+ messages in thread
From: Yaron Minsky @ 2005-04-01  2:02 UTC (permalink / raw)
  To: Caml Mailing List

The last example I posted about had to do with variant types.  Here's
another interseting little typing surprise having to do with record
types:

# type 'a t = { foo: 'a };;
type 'a t = { foo : 'a; }
# let f x = { x with foo = 3 };;
val f : 'a -> int t = <fun>

I can kind of see how this happened, since after all, the result of (f
x) does not depend in any way on x.  And yet, it seems like the
unification rules should force f to have time ('a t -> int t).

y


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

end of thread, other threads:[~2005-04-01 10:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-01  2:02 Another polymorphism puzzle Yaron Minsky
2005-04-01  2:32 ` [Caml-list] " Karl Zilles
2005-04-01  2:52 ` Manos Renieris
2005-04-01  4:29   ` Jacques Garrigue
2005-04-01  9:45     ` Alex Baretta

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