From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA20495; Mon, 22 Dec 2003 14:33:34 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA20822 for ; Mon, 22 Dec 2003 14:33:33 +0100 (MET) Received: from alex.baretta.com ([213.255.109.130]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hBMDXRb00339 for ; Mon, 22 Dec 2003 14:33:27 +0100 (MET) Received: from baretta.com (localhost.localdomain [127.0.0.1]) by alex.baretta.com (8.12.8/8.12.8) with ESMTP id hBMAoW5o021840 for ; Mon, 22 Dec 2003 11:50:33 +0100 Message-ID: <3FE6CC78.8050506@baretta.com> Date: Mon, 22 Dec 2003 11:50:32 +0100 From: Alex Baretta User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ocaml Subject: [Caml-list] Polymorphic records typing question Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; baretta:01 baretta:01 val:01 foo:01 val:01 foo:01 unacceptable:01 caml:01 alex:01 alex:01 rec:01 polymorphic:01 typing:03 recursive:03 poly:04 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Here's a puzzle for the Caml breeders: # type poly = { f : 'a . 'a -> 'a };; type poly = { f : 'a. 'a -> 'a; } # let id x = x;; val id : 'a -> 'a = # let foo = { f = id };; val foo : poly = {f = } # let rec id x = x and foo = { f = id } ;; This field value has type 'a -> 'a which is less general than 'b. 'b -> 'b Why is this last recursive definition unacceptable? Alex ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners