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.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 4F454BC6B for ; Thu, 20 Sep 2007 17:04:11 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAD0p8kbUGyobimdsb2JhbACOFQEBAQgEBg8RBw X-IronPort-AV: E=Sophos;i="4.20,279,1186351200"; d="asc'?vcf'?scan'208";a="16483388" Received: from smtp1-g19.free.fr ([212.27.42.27]) by mail4-smtp-sop.national.inria.fr with ESMTP; 20 Sep 2007 17:05:34 +0200 Received: from smtp1-g19.free.fr (localhost.localdomain [127.0.0.1]) by smtp1-g19.free.fr (Postfix) with ESMTP id 4EFF31AB2FA for ; Thu, 20 Sep 2007 17:05:34 +0200 (CEST) Received: from Tocksi.local (unknown [82.254.225.183]) by smtp1-g19.free.fr (Postfix) with ESMTP id 1ED7A1AB2DC for ; Thu, 20 Sep 2007 17:05:34 +0200 (CEST) Message-ID: <46F28C38.2080801@univ-savoie.fr> Date: Thu, 20 Sep 2007 17:05:28 +0200 From: Christophe Raffalli User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: polymorphic variant X-Enigmail-Version: 0.95.3 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigAB881BAA1163E94A9E139B56" X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 val:01 val:01 ocaml:01 chablais:01 73376:01 univ-savoie:01 polymorphic:01 lama:01 functions:01 variant:02 X-Attachments: cset="utf-8" name="Christophe.Raffalli.vcf" name="Christophe.Raffalli.vcf" type="application/pgp-signature" name="signature.asc" name="signature.asc" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAB881BAA1163E94A9E139B56 Content-Type: multipart/mixed; boundary="------------070905050608070900050904" This is a multi-part message in MIME format. --------------070905050608070900050904 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Can someone explain to me why the two following functions are typed so differently: --------------- Objective Caml version 3.10.0 # let f =3D function `T, y -> y | x, `T -> x | `F, `F -> `F | `F, _ -> `F ;; Warning U: this match case is unused. val f : [ `F | `T ] * [ `F | `T ] -> [ `F | `T ] =3D # let g =3D function `T, y -> y | x, `T -> `F | `F, `F -> `F | `F, _ -> `F ;; val g : [< `F | `T ] * ([> `F | `T ] as 'a) -> 'a =3D ------- The decision to close the second column seems to depend upon the right ha= nd side of the pattern, which seems excluded by Jacques Garrigue's paper = about deep pattern matching ... According to this paper, the second funct= ion is strangely typed. What is implemented in OCaml ? Regards, --=20 Christophe Raffalli Universite de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tel: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution=20 can check this signature. The public key is stored on www.keyserver.net --------------------------------------------- --------------070905050608070900050904 Content-Type: text/x-vcard; charset=utf-8; name="Christophe.Raffalli.vcf" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Christophe.Raffalli.vcf" begin:vcard fn:Christophe Raffalli n:Raffalli;Christophe org:LAMA (UMR 5127) email;internet:christophe.raffalli@univ-savoie.fr title;quoted-printable:Ma=3DC3=3DAEtre de conf=3DC3=3DA9rences tel;work:+33 4 79 75 81 03 note:http://www.lama.univ-savoie.fr/~raffalli x-mozilla-html:TRUE version:2.1 end:vcard --------------070905050608070900050904-- --------------enigAB881BAA1163E94A9E139B56 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG8ow9i9jr/RgYAS4RAoRvAKCAQocXBeeEDOJNJvp5K8SswPY/0ACffSyz LKBKiGWtxLveGWCT8RSBPWo= =khhK -----END PGP SIGNATURE----- --------------enigAB881BAA1163E94A9E139B56--