From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 43B46BC48 for ; Fri, 1 Apr 2005 04:52:08 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j312q7up000590 for ; Fri, 1 Apr 2005 04:52:07 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA21983 for ; Fri, 1 Apr 2005 04:52:07 +0200 (MET DST) Received: from salt.cs.brown.edu (salt.cs.brown.edu [128.148.32.122]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j312q6Jq000587 for ; Fri, 1 Apr 2005 04:52:07 +0200 Received: from localhost (localhost [127.0.0.1]) by salt.cs.brown.edu (Postfix) with ESMTP id 5E6CE386458; Thu, 31 Mar 2005 21:52:06 -0500 (EST) Received: from salt.cs.brown.edu ([127.0.0.1]) by localhost (salt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06045-09; Thu, 31 Mar 2005 21:52:06 -0500 (EST) Received: from null.cs.brown.edu (imap1.cs.brown.edu [128.148.38.151]) by salt.cs.brown.edu (Postfix) with ESMTP id EF40A386427; Thu, 31 Mar 2005 21:52:05 -0500 (EST) Received: from miette.cs.brown.edu (miette [128.148.38.66]) by null.cs.brown.edu (Postfix) with ESMTP id EAB9514800F; Thu, 31 Mar 2005 21:52:05 -0500 (EST) Received: by miette.cs.brown.edu (Postfix, from userid 3125) id 947CD180DE; Thu, 31 Mar 2005 21:52:05 -0500 (EST) Date: Thu, 31 Mar 2005 21:52:05 -0500 From: Manos Renieris To: yminsky@cs.cornell.edu Cc: Caml Mailing List Subject: Re: [Caml-list] Another polymorphism puzzle Message-ID: <20050401025205.GA4723@cs.brown.edu> Reply-To: Manos Renieris Mail-Followup-To: yminsky@cs.cornell.edu, Caml Mailing List References: <891bd339050331180214df95db@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <891bd339050331180214df95db@mail.gmail.com> User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at cs.brown.edu X-Miltered: at nez-perce with ID 424CB757.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 424CB756.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; renieris:01 caml-list:01 polymorphism:01 foo:01 val:01 foo:01 val:01 bug:01 expr:01 yaron:01 minsky:01 unification:01 caml-list:01 beginner's:01 ocaml:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Worse: # let f x = { () with foo = 3};; val f : 'a -> int t = # let f x = { 42 with foo = 3};; val f : 'a -> int t = 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 = > > 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