From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 5A367BC69 for ; Mon, 5 Mar 2007 02:25:19 +0100 (CET) Received: from maury.inria.fr (maury.inria.fr [192.93.2.7]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l251PIkS032042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 5 Mar 2007 02:25:19 +0100 Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by maury.inria.fr (8.13.6/8.13.6) with ESMTP id l251PGiB008558 for ; Mon, 5 Mar 2007 02:25:18 +0100 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.7/8.13.7) with ESMTP id l251P11Y011452; Mon, 5 Mar 2007 10:25:01 +0900 (JST) Date: Mon, 05 Mar 2007 10:24:59 +0900 (JST) Message-Id: <20070305.102459.15248140.garrigue@math.nagoya-u.ac.jp> To: lukstafi@gmail.com Cc: eliot@generation.net, caml-list@inria.fr Subject: Re: [Caml-list] records with polymorphic variants? From: Jacques Garrigue In-Reply-To: <4a708d20703040404y4973ca00if881bd4ef65f3a1e@mail.gmail.com> References: <45EA613F.3030104@generation.net> <4a708d20703040404y4973ca00if881bd4ef65f3a1e@mail.gmail.com> X-Mailer: Mew version 4.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 45EB717E.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Miltered: at maury with ID 45EB717C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; variants:01 lukasz:01 syntax:01 foo:01 foo:01 syntax:01 bug:01 bug:01 unnamed:98 unbound:01 polymorphic:01 caml-list:01 int:01 variant:02 parameter:02 From: "Lukasz Stafiniak" > Try the syntax: > > # type r = {x : [> foo]};; > Characters 14-21: > type r = {x : [> foo]};; > ^^^^^^^ > Unbound type parameter [..] > > The open variant type introduces a type parameter, which is not bound > in definition of type r. I don't think these unnamed parameters can be > bound, so that you could write: The correct syntax in this case is type r = {x : 'a. [> foo] as 'a} Unfortunately there seems to be a bug in 3.09, so that it doesn't work. This will work again in 3.10. (This was a stupid bug, as usual. Other cases, like type r = {x : 'a. as 'a} do work in 3.09.) Note that this seems not to be what the original poster wanted actually, which was just a constrained type. Jacques Garrigue