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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 07CB7BC69 for ; Fri, 16 Nov 2007 17:46:17 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABZYPUdIDsznfGdsb2JhbACPDQEBCQQEERMFgRE X-IronPort-AV: E=Sophos;i="4.21,426,1188770400"; d="scan'208";a="19391867" Received: from qb-out-0506.google.com ([72.14.204.231]) by mail4-smtp-sop.national.inria.fr with ESMTP; 16 Nov 2007 17:46:16 +0100 Received: by qb-out-0506.google.com with SMTP id e11so351639qbe for ; Fri, 16 Nov 2007 08:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=ont7KVc7LSeY4ZAFjBHvxfD/rWeObz2fAm1o79vJ+tY=; b=BOST0NISyXVKdA0lmYjrveMB2wfaM7lVsen2OMf3+H614huwRer6tH4yArG0+of0gV4I1D3ev/vKP1fy10N5PCHWRd1fmI946VmzAOoIyRoEF0NpXmxEm08cW+msCgEZEashsTrgsHVvzuq/VPop3F2UkTyWrhK6wkl7E0HxLMw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Md6fb2XobngTZkjPkSoa9xWDL/pQgnoBZQF0Vy2IfhDFayN4+dpc1Q8JG4tDrSBmbk8cCAXA1RyJLuPEzVN23Ce6NRrQmrDfUCK9YlYuotX0XRTpQjYTl0MwBdVk58TD6nufEk5v8swUgDJ77434JZV5/iosuNMPx5pLACGKgto= Received: by 10.142.237.20 with SMTP id k20mr664352wfh.1195231574316; Fri, 16 Nov 2007 08:46:14 -0800 (PST) Received: by 10.142.115.3 with HTTP; Fri, 16 Nov 2007 08:46:14 -0800 (PST) Message-ID: <9d3ec8300711160846y735b08cfh42cbcf507f1d5d95@mail.gmail.com> Date: Fri, 16 Nov 2007 11:46:14 -0500 From: "Till Varoquaux" To: "Martin Jambon" Subject: Re: [Caml-list] Compiler feature - useful or not? Cc: "Alain Frisch" , caml-list In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <473A363F.2080301@gmail.com> <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> X-Spam: no; 0.00; compiler:01 cduce:01 cduce:01 ens-lyon:01 frisch:01 ocaml's:01 cvs:01 ocaml:01 notation:01 val:01 bool:01 beginner's:01 ocaml:01 bug:01 2007,:98 Funny you'd be talking to the creator of CDuce (www.cduce.org) about defining types as sets... Till On Nov 16, 2007 11:43 AM, Martin Jambon wrote: > 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 > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- http://till-varoquaux.blogspot.com/