From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 10EE67EF10 for ; Wed, 25 Feb 2015 09:41:40 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dra-news@metastack.com) identity=pra; client-ip=62.13.148.93; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of dra-news@metastack.com designates 62.13.148.93 as permitted sender) identity=mailfrom; client-ip=62.13.148.93; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@outmail148093.authsmtp.net) identity=helo; client-ip=62.13.148.93; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="postmaster@outmail148093.authsmtp.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BlAQBliu1UnF2UDT5bDoJUgU4EsEkGmEQCgSNDAQEBAQEBEAEBAQEBCAsJCRQuhA8BAQEDAQM3PwULAgEIDgoKFBAyJQIEAQ0FCBOIDAkD1FMBAQEBAQUBAQEBAQEBARqGB4UMhD0xB4MXgRQFmSABkzqDUz1vgUR/AQEB X-IPAS-Result: A0BlAQBliu1UnF2UDT5bDoJUgU4EsEkGmEQCgSNDAQEBAQEBEAEBAQEBCAsJCRQuhA8BAQEDAQM3PwULAgEIDgoKFBAyJQIEAQ0FCBOIDAkD1FMBAQEBAQUBAQEBAQEBARqGB4UMhD0xB4MXgRQFmSABkzqDUz1vgUR/AQEB X-IronPort-AV: E=Sophos;i="5.09,643,1418079600"; d="scan'208";a="101240366" Received: from outmail148093.authsmtp.net ([62.13.148.93]) by mail3-smtp-sop.national.inria.fr with ESMTP; 25 Feb 2015 09:41:39 +0100 Received: from mail-c237.authsmtp.com (mail-c237.authsmtp.com [62.13.128.237]) by punt16.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t1P8faMw060651; Wed, 25 Feb 2015 08:41:36 GMT Received: from romulus.metastack.com (cpc1-cmbg5-0-0-cust241.5-4.cable.virginm.net [81.98.252.242]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id t1P8fZ0X031275; Wed, 25 Feb 2015 08:41:35 GMT Received: from remus.metastack.local (remus.metastack.com [172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id t1P8fYpj027493 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Wed, 25 Feb 2015 08:41:34 GMT Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%10]) with mapi id 14.03.0224.002; Wed, 25 Feb 2015 08:41:33 +0000 From: David Allsopp To: Leo White , Ben Millwood CC: Jeremy Yallop , OCaml List Thread-Topic: [Caml-list] Match error with abstract types in modules Thread-Index: AQHQUHZ2HoJ7Sr46RUmuhYPLJuzpG50BCUfA Date: Wed, 25 Feb 2015 08:41:32 +0000 Message-ID: References: <000401d05056$ed605f70$c8211e50$@metastack.com> <87wq372noc.fsf@study.localdomain> <87k2z72ewr.fsf@study.localdomain> In-Reply-To: <87k2z72ewr.fsf@study.localdomain> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.0.18] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 172.16.0.20 X-Server-Quench: 1b8b6f84-bcca-11e4-9f74-002590a135d3 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZZVg1f DC4bFwdFRBksPQFF ChxFJgxfNl8UURhQ KkJXbgYSJgdBAn9U UXkJW1VRQF15U2d0 YQlUIw1cfENGQQdv UlZLRlBNFgB3AVJF B34WBHNyHwVFeXx3 YAhjX3lZVAp7J04v RBhcEXBUNjQxdWEe BURFflVTdB5Kfh1A Y1AuVXAINWZJBA9q VzwYNjU1eDFeMzhg CiQEMVkSCUsRBDkm Dw8DATVnFEceWz86 JABuNk8EEV1ZM0N6 NFwtRFYVKHc8 X-Authentic-SMTP: 61633634383431.1024:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 81.98.252.242/25 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. Subject: RE: [Caml-list] Match error with abstract types in modules Leo White wrote: > Ben Millwood writes: >=20 > > I think the issue would be substantially mitigated were it not for the > > simple fact that [type 'a t] in a signature means "abstract type", > > whereas [type 'a t] in a structure means "empty type". The fact that > > there is no syntactic distinction, and indeed *no way to make one* > > caused me a great deal of confusion some time ago when I had a problem > > similar to David's. The context of my original problem was the initially confusing assertion by= the compiler that two "different" BatSet.t uses were the same. I guessed t= hat what I was seeing was part of the "easy to shoot yourself in the foot" = comment in its documentation! > You can make an empty type (or at least a type for which there are no > expressions) using: >=20 > type 'a t =3D private T The obvious "solution" with sets is to use the functor version therefore an= d have a module for each point (I believe that's 50% of the reason for doin= g it - the other being that you don't need to store the comparison function= in the value itself), but is there (in theory) a relatively easy kind of a= nnotation which could be added to type 'a t in a signature which would tell= the compiler that 'a t and 'b are equal and compatible iff 'a and 'b are e= qual/compatible but still remain abstract? David