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.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id DF26ABC69 for ; Sun, 4 Mar 2007 17:49:48 +0100 (CET) Received: from mail.colba.net (mail.colba.net [207.107.221.4]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l24Gnltd018714 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sun, 4 Mar 2007 17:49:48 +0100 Received: from [192.168.0.103] (215.84.252.216.dsl1.colba.net [216.252.84.215]) by mail.colba.net (8.12.11/8.12.1) with ESMTP id l24Gnf8A035728; Sun, 4 Mar 2007 11:49:41 -0500 (EST) Message-ID: <45EAF8C9.9010800@generation.net> Date: Sun, 04 Mar 2007 11:50:17 -0500 From: Eliot Handelman Reply-To: eliot@generation.net User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: Lukasz Stafiniak Cc: Zheng Li , caml-list@inria.fr Subject: Re: [Caml-list] Re: records with polymorphic variants? References: <45EA613F.3030104@generation.net> <87k5xxjdgv.fsf@gmail.com> <4a708d20703040824o20b1d572h786d46da586c9977@mail.gmail.com> In-Reply-To: <4a708d20703040824o20b1d572h786d46da586c9977@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 45EAF8AB.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; variants:01 lukasz:01 polymorphic:01 polymorphic:01 wrote:01 wrote:01 caml-list:01 pps:01 jussieu:01 constraint:01 constraint:01 int:01 expression:02 string:02 string:02 Lukasz Stafiniak wrote: > On 3/4/07, Zheng Li wrote: > > Yes, but the type f itself is not polymorphic, it is not [> f]. >> >> I guess you want the follows >> >> # type 'a r = { x : 'a } constraint 'a = [> f] >> type 'a r = { x : 'a; } constraint 'a = [> f ] >> # {x = "test"} >> Characters 6-12: >> { x = "test"};; >> ^^^^^^ >> This expression has type string but is here used with type [> f ] >> # {x = `B "test"} >> - : [> `A of int | `B of string ] r = {x = `B "test"} >> > Nice! I didn't realize this is possible. Thanks. Just what I was looking for -- many thanks. -- eliot