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 2C65BBC69 for ; Mon, 5 Mar 2007 09:02:03 +0100 (CET) Received: from rabbit.math.nagoya-u.ac.jp (rabbit.math.nagoya-u.ac.jp [133.6.130.5]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l25821fA014850 for ; Mon, 5 Mar 2007 09:02:02 +0100 Received: from localhost (rabbit-172 [172.16.254.254]) by rabbit.math.nagoya-u.ac.jp (8.12.11/3.7W) with ESMTP id l2581ngS005396; Mon, 5 Mar 2007 17:01:49 +0900 (JST) Date: Mon, 05 Mar 2007 17:01:48 +0900 (JST) Message-Id: <20070305.170148.2004170112.garrigue@math.nagoya-u.ac.jp> To: eliot@generation.net Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: records with polymorphic variants? From: Jacques GARRIGUE In-Reply-To: <45EBAA19.6030605@generation.net> References: <4a708d20703040824o20b1d572h786d46da586c9977@mail.gmail.com> <45EBAA19.6030605@generation.net> X-Mailer: Mew version 4.2 on Emacs 21.4 / 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 45EBCE79.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; variants:01 syntax:01 inference:01 vouillon:01 remy's:01 syntax:01 polymorphic:01 wrote:01 caml-list:01 constraint:01 int:01 jambon:01 objects:02 objects:02 garrigue:03 From: Eliot Handelman > Martin Jambon wrote: > > > > You can do this directly if you prefer: > > > > type 'a f = 'a > > constraint 'a = [> `A of int ] > > This is exactly what I was trying to do in the first place. > Where exactly is the main documentation for this syntax? Not in > JG's papers, unless I've missed something, as is possible. It's not in my papers, because it is a rather subtle feature of the type system, and is not directly related to type inference. It should be in Vouillon&Remy's paper about objects. It is documented in the manual, at the very end of section 6.8.1. There are some examples involving objects (using the class syntax) in section 3.10 of the tutorial. Jacques Garrigue