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=3.2 required=5.0 tests=DNS_FROM_RFC_ABUSE, RCVD_IN_BL_SPAMCOP_NET,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr 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 6917DBB83 for ; Sun, 3 Sep 2006 03:12:21 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.233]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k831CKAH019796 for ; Sun, 3 Sep 2006 03:12:21 +0200 Received: by wx-out-0506.google.com with SMTP id s7so1540606wxc for ; Sat, 02 Sep 2006 18:12:20 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=Svn051wQIw+T1RrvcUeTMLIAmLT6EIvC3MlKq90qoZGk02sUjnWsprlVfCuXdqbJrMg95I/rwakCg/+OsAjmLWgD3qamithCO0wN98tp6LNFKahjCq0Eo2yYa5/Xulcp8y0H790QryesTH0v+PaGXiyLutaSMjJS5o1qsmKk9Gg= Received: by 10.70.8.8 with SMTP id 8mr5182363wxh; Sat, 02 Sep 2006 18:12:19 -0700 (PDT) Received: from ?192.168.0.3? ( [70.19.59.48]) by mx.gmail.com with ESMTP id g7sm3585870wra.2006.09.02.18.12.19; Sat, 02 Sep 2006 18:12:19 -0700 (PDT) In-Reply-To: <1157244509.12057.29.camel@rosella.wigram> References: <012901c6cdec$64edf490$6a7ba8c0@treble> <1157138993.22787.34.camel@rosella.wigram> <1157244509.12057.29.camel@rosella.wigram> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <23AFCAC0-88AD-4FD3-85D3-1F37798DF59B@gmail.com> Cc: caml-list Content-Transfer-Encoding: 7bit From: Andres Varon Subject: Re: [Caml-list] Polymorphic variants problem Date: Sat, 2 Sep 2006 21:12:16 -0400 To: skaller X-Mailer: Apple Mail (2.752.2) X-j-chkmail-Score: MSGID : 44FA2BF4.000 on nez-perce : j-chkmail score : X : 0/20 1 X-Miltered: at nez-perce with ID 44FA2BF4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; variants:01 inference:01 compiler:01 polymorphic:01 caml-list:01 define:01 argument:02 let:03 let:03 fault:04 problem:05 problem:05 refined:06 looks:08 fun:08 > > Now, I just tried to use my super term union, but I ran > into a problem. It looks like a fault in type inference, > something like this: > > let f (x:[`A|`B]) = .. > let g (x:[`A]) = .. > .. > fun x -> > f x; > g x; > .. > You have to define it as follows: let f (x : [< `A | `B ]) = .. let g (x : [`A]) = to let the compiler know that the argument of f could be refined further.