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.2 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 97390BC69 for ; Fri, 16 Nov 2007 17:43:48 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABZYPUdCbwQZnmdsb2JhbACPDQEBAQEHBAYpgQ8 X-IronPort-AV: E=Sophos;i="4.21,426,1188770400"; d="scan'208";a="4580780" Received: from out1.smtp.messagingengine.com ([66.111.4.25]) by mail1-smtp-roc.national.inria.fr with ESMTP; 16 Nov 2007 17:43:48 +0100 Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 3DFF947956; Fri, 16 Nov 2007 11:43:47 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Fri, 16 Nov 2007 11:43:47 -0500 X-Sasl-enc: 3cDc6vzXfiqmIijYjvNFglqwKKLEKDMNBGj+0WecuBvD 1195231426 Received: from [192.168.1.11] (unknown [90.46.0.137]) by mail.messagingengine.com (Postfix) with ESMTP id 7AB342A68B; Fri, 16 Nov 2007 11:43:46 -0500 (EST) Date: Fri, 16 Nov 2007 17:43:39 +0100 (CET) From: Martin Jambon X-X-Sender: martin@martin.ec.wink.com To: Alain Frisch Cc: caml-list Subject: Re: [Caml-list] Compiler feature - useful or not? In-Reply-To: Message-ID: References: <473A363F.2080301@gmail.com> <891bd3390711131608g48b584a4n6b0ccab95d7de3f3@mail.gmail.com> <20071114075827.GA24058@yquem.inria.fr> <473AEC04.3030303@frisch.fr> <20071114143524.GA4423@yquem.inria.fr> <473B249D.9040703@frisch.fr> <20071114184352.GB28796@yquem.inria.fr> <473BE750.9060301@frisch.fr> <20071115132649.GB15754@yquem.inria.fr> <891bd3390711151630x238b8eddod5b7462d0fa1c735@mail.gmail.com> <473D61A3.9090708@frisch.fr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam: no; 0.00; ens-lyon:01 compiler:01 frisch:01 ocaml's:01 cvs:01 ocaml:01 notation:01 val:01 bool:01 2007,:98 2007,:98 polymorphic:01 wrote:01 wrote:01 caml-list:01 On Fri, 16 Nov 2007, Martin Jambon wrote: > On Fri, 16 Nov 2007, Alain Frisch wrote: > >> Martin Jambon wrote: >> > You can write >> > match (x : Priv_int.t) with 0 -> true | _ -> false >> >> Actually, you cannot do that, at least with private types as implemented >> in OCaml's CVS. And this is to be expected given the lack of implicit >> subsumption in OCaml. If you were able to do such a thing, what type >> schema would you give to: >> >> let f = function 0 -> true | _ -> false >> >> ? > > Using the notation for polymorphic variant types: > > val f : [< int ] -> bool > > Type [> int ] would be the same as [ int ] or int. Please don't take my suggestions too seriously, but it could be cool to define types such as: type bit = [ 0 | 1 ] Martin -- http://wink.com/profile/mjambon http://martin.jambon.free.fr