From: Manos Renieris <er@cs.brown.edu>
To: yminsky@cs.cornell.edu
Cc: Caml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Another polymorphism puzzle
Date: Thu, 31 Mar 2005 21:52:05 -0500 [thread overview]
Message-ID: <20050401025205.GA4723@cs.brown.edu> (raw)
In-Reply-To: <891bd339050331180214df95db@mail.gmail.com>
Worse:
# let f x = { () with foo = 3};;
val f : 'a -> int t = <fun>
# let f x = { 42 with foo = 3};;
val f : 'a -> int t = <fun>
I think this qualifies as a bug. Especially since the documentation
says the expr on the left hand side of with has to be a record.
Thu, Mar 31, 2005 at 09:02:14PM -0500, Yaron Minsky wrote:
> 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
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
next prev parent reply other threads:[~2005-04-01 2:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-01 2:02 Yaron Minsky
2005-04-01 2:32 ` [Caml-list] " Karl Zilles
2005-04-01 2:52 ` Manos Renieris [this message]
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=20050401025205.GA4723@cs.brown.edu \
--to=er@cs.brown.edu \
--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