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.5 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id C9ADCBBAF for ; Sat, 9 Aug 2008 18:09:01 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar4AAM9dnUjOvjGxmmdsb2JhbACRUwEBAQEBCAUIBxEDmTc X-IronPort-AV: E=Sophos;i="4.31,334,1215381600"; d="scan'208";a="15863677" Received: from web54607.mail.re2.yahoo.com ([206.190.49.177]) by mail3-smtp-sop.national.inria.fr with SMTP; 09 Aug 2008 18:09:01 +0200 Received: (qmail 15887 invoked by uid 60001); 9 Aug 2008 16:08:59 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=zi8kttcxmdQaStGe6B6J+wSBwxxLSKzNPw9U050mF4rmkCD9efbj6AfwUHyP1u9ffBUaPw6dzZzM4Ks6mw4heQtKHVdvXffsD0OxquDIKqr/PJAsOcu+8ctVEXKJcpw6dyexiBsf0Bfpnj1tWmdpJ6SlBwJdshKbhxasHzwWJFs=; Received: from [85.240.97.201] by web54607.mail.re2.yahoo.com via HTTP; Sat, 09 Aug 2008 09:08:59 PDT X-Mailer: YahooMailWebService/0.7.218 Date: Sat, 9 Aug 2008 09:08:59 -0700 (PDT) From: Dario Teixeira Subject: Re: [Caml-list] Private and type constraints To: caml-list@yquem.inria.fr In-Reply-To: <982865.39461.qm@web54602.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <775001.15788.qm@web54607.mail.re2.yahoo.com> X-Spam: no; 0.00; semantics:01 foobar:01 cheers:01 foobar:01 sig:01 foo:01 foo:01 val:01 val:01 struct:01 caml-list:01 functions:01 constructor:01 constraint:01 constraint:01 Hi, I just noted that there's already a ticket (#4580) related to this problem: http://caml.inria.fr/mantis/view.php?id=3D4580 My doubts are a) whether the code below will be correct for 3.11 final; and b) whether its semantics are equivalent to other uses of 'private', namely that external pattern-matching on Foobar.t values is allowed, but the construction of new values must be done through the constructor functions. Any thoughts? Thanks in advance for your time! Cheers, Dario Teixeira =20 module Foobar: sig type foo_t=3D [ `A ] type bar_t =3D [ `B ] type foobar_t =3D [ foo_t | bar_t ] type 'a t =3D private 'a constraint 'a =3D [< foobar_t ] =20 val make_a: unit -> foo_t t val make_b: unit -> bar_t t end =3D struct type foo_t =3D [ `A ] type bar_t =3D [ `B ] type foobar_t =3D [ foo_t | bar_t ] type 'a t =3D 'a constraint 'a =3D [< foobar_t ] let make_a () =3D `A let make_b () =3D `B end =0A=0A=0A __________________________________________________________= =0ANot happy with your email address?.=0AGet the one you really want - mill= ions of new email addresses available now at Yahoo! http://uk.docs.yahoo.co= m/ymail/new.html