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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C3C50BB83 for ; Fri, 1 Sep 2006 22:43:09 +0200 (CEST) Received: from coriana6.cis.mcmaster.ca (coriana6.CIS.McMaster.CA [130.113.128.17]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k81Kh89B026804 for ; Fri, 1 Sep 2006 22:43:09 +0200 Received: from Dura7.UTS.McMaster.CA (dura7.UTS.McMaster.CA [130.113.196.62]) by coriana6.cis.mcmaster.ca (8.13.7/8.13.7) with ESMTP id k81KgpvS026322; Fri, 1 Sep 2006 16:42:57 -0400 (EDT) Received: from cgpsrv2.cis.mcmaster.ca (univmail.CIS.mcmaster.ca [130.113.64.46]) by Dura7.UTS.McMaster.CA (8.13.7/8.13.7) with ESMTP id k81Kga10023646; Fri, 1 Sep 2006 16:42:36 -0400 Received: from [130.113.68.27] (account carette@univmail.cis.mcmaster.ca [130.113.68.27] verified) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro SMTP 4.1.8) with ESMTP id 138067363; Fri, 01 Sep 2006 16:42:36 -0400 Message-ID: <44F89ACA.2000202@mcmaster.ca> Date: Fri, 01 Sep 2006 16:40:42 -0400 From: Jacques Carette Organization: McMaster University User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 To: David Allsopp Cc: "'OCaml List'" Subject: Re: [Caml-list] Re: Polymorphic variants question References: <015101c6ce00$d47c36f0$6a7ba8c0@treble> In-Reply-To: <015101c6ce00$d47c36f0$6a7ba8c0@treble> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Version-Mac: 4.7.1.128075, Antispam-Engine: 2.4.0.264935, Antispam-Data: 2006.9.1.122943 X-PerlMx-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' X-Miltered: at concorde with ID 44F89B5C.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; variants:01 annotation:01 notation:01 bounded:01 translated:01 wrote:01 polymorphic:01 caml-list:01 inferred:02 mcmaster:02 types:03 jacques:03 jacques:03 let:03 let:03 David Allsopp wrote: > Incidentally, if I use an annotation free version > > let f x = if x = `A then (true, `B) else (false, (x : [< `A | `C] :> [> `A | > `C])) > > then the inferred type of x is [< `A | `C > `A ] ... what does that mean? > This is a "point free" notation for what mathematicians would have written `A <= x <= `A | `C In other words, x is strictly bounded above and below by those 2 types. Translated into english, this means that the type from which x comes *must* contain an `A and *may* contain a `C and *must not* contain anything else. For example, trying let g x = f (snd (f x)) would not type. Jacques