From: Yaron Minsky <yminsky@gmail.com>
To: Caml Mailing List <caml-list@inria.fr>
Subject: Another polymorphism puzzle
Date: Thu, 31 Mar 2005 21:02:14 -0500 [thread overview]
Message-ID: <891bd339050331180214df95db@mail.gmail.com> (raw)
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
next reply other threads:[~2005-04-01 2:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-01 2:02 Yaron Minsky [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=891bd339050331180214df95db@mail.gmail.com \
--to=yminsky@gmail.com \
--cc=caml-list@inria.fr \
--cc=yminsky@cs.cornell.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox