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 98A817EE4B for ; Thu, 10 Oct 2013 10:07:52 +0200 (CEST) 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.136.30; 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.136.30 as permitted sender) identity=mailfrom; client-ip=62.13.136.30; 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@outmail136030.authsmtp.net) identity=helo; client-ip=62.13.136.30; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="postmaster@outmail136030.authsmtp.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArkXALRfVlI+DYge/2dsb2JhbABZgmYhOFKsSgMElBc4gR8WdIIlAQEBBCcTTwIBCBgKFBAyJQIEG4d/Awi5I48WOIMfgQQDmAWBL5BTgySCKg X-IPAS-Result: ArkXALRfVlI+DYge/2dsb2JhbABZgmYhOFKsSgMElBc4gR8WdIIlAQEBBCcTTwIBCBgKFBAyJQIEG4d/Awi5I48WOIMfgQQDmAWBL5BTgySCKg X-IronPort-AV: E=Sophos;i="4.90,1070,1371074400"; d="scan'208";a="29773549" Received: from outmail136030.authsmtp.net ([62.13.136.30]) by mail3-smtp-sop.national.inria.fr with ESMTP; 10 Oct 2013 10:07:51 +0200 Received: from mail-c237.authsmtp.com (mail-c237.authsmtp.com [62.13.128.237]) by punt12.authsmtp.com (8.14.2/8.14.2) with ESMTP id r9A87o7w074244 for ; Thu, 10 Oct 2013 09:07:50 +0100 (BST) Received: from romulus.metastack.com (cpc1-cmbg5-0-0-cust241.5-4.cable.virginmedia.com [81.98.252.242]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id r9A87mvq041987 for ; Thu, 10 Oct 2013 09:07:48 +0100 (BST) 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 r9A87mrp015293 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Thu, 10 Oct 2013 09:07:48 +0100 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.0158.001; Thu, 10 Oct 2013 09:07:48 +0100 From: David Allsopp To: OCaml List Thread-Topic: [Caml-list] exhaustiveness checking within a submatch Thread-Index: AQHOxY7uGx55yc3HdUasqefqnyXKuJntlKUg Date: Thu, 10 Oct 2013 08:07:46 +0000 Message-ID: References: In-Reply-To: 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: 0da61032-3183-11e3-94fa-002590a135d3 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZZVg1f DC4bFwdFRBksPQFF ChxFJgxfNlEAUAAU NkdBMnJCKUARQBdY XSRSCkoCEhNwWXwK OE5ObwVcYVpOVg9q V0JNSxxaFRthCQID AxwAUB1waAdDZ34+ J08TVncGGgV6cUd0 SkkaF2wBZylgPDEZ UUBbdR5XcQtJYx5E P1NiXXdbMHgHZnhl Tlc6ZmtsMW5JEgkH CjImJFcWBEIKBSIJ Dx0SHTwyBlEEWSg1 Igc9YlUcEU0SM0M9 eUQgRVIZNVcbQhZD FUREHCRZT9j/ 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] exhaustiveness checking within a submatch Martin DeMello wrote: > Just curious as to why the compiler can't handle this, since in theory > everything is statically deducible: >=20 > # type test =3D A | B | C | D;; > type test =3D A | B | C | D >=20 > # let f =3D A;; > val f : test =3D A >=20 > # match f with A -> 1 | B -> 2 | C | D -> ( match f with C -> 3 | D -> > 4);; > Characters 40-71: > Warning > 8: this pattern-matching is not exhaustive. > Here is an > example of a value that is not matched: > (A|B) > Characters 40-71: > Warning 8: this pattern-matching is not exhaustive. > Here is an example of a value that is not matched: > (A|B) > - : int =3D 1 http://caml.inria.fr/pub/ml-archives/caml-list/2007/02/d35648b13d76f1717edb= f41101dc913f.en.html David