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 F1DA37EFCD for ; Tue, 14 Oct 2014 14:34:11 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of goswin-v-b@web.de) identity=pra; client-ip=212.227.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of goswin-v-b@web.de designates 212.227.15.4 as permitted sender) identity=mailfrom; client-ip=212.227.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="goswin-v-b@web.de"; 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@mout.web.de) identity=helo; client-ip=212.227.15.4; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="goswin-v-b@web.de"; x-sender="postmaster@mout.web.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsYBANwWPVTU4w8EnGdsb2JhbABbg2FYzCyBZYVwAoETFgERAQEBAQEGDQkJFC6EAwEBBCcTTwsYCSUPBSiIXQEYvxEfhmYBCyCQTBaDF4EeAQSWO4cPh08TkilqgkoBAQE X-IPAS-Result: AsYBANwWPVTU4w8EnGdsb2JhbABbg2FYzCyBZYVwAoETFgERAQEBAQEGDQkJFC6EAwEBBCcTTwsYCSUPBSiIXQEYvxEfhmYBCyCQTBaDF4EeAQSWO4cPh08TkilqgkoBAQE X-IronPort-AV: E=Sophos;i="5.04,717,1406584800"; d="scan'208";a="83199623" Received: from mout.web.de ([212.227.15.4]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Oct 2014 14:34:11 +0200 Received: from frosties.localnet ([95.208.222.117]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0MN47k-1XXOXK274K-006d4e for ; Tue, 14 Oct 2014 14:34:10 +0200 Received: from mrvn by frosties.localnet with local (Exim 4.82) (envelope-from ) id 1Xe1In-0007Xx-Ry for caml-list@inria.fr; Tue, 14 Oct 2014 14:34:09 +0200 Date: Tue, 14 Oct 2014 14:34:09 +0200 From: Goswin von Brederlow To: caml-list@inria.fr Message-ID: <20141014123409.GA28489@frosties> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Provags-ID: V03:K0:MuvCMwyxXyAu6LxgHDrwHqGEX1Z9XYXtyKADmkTnmZIGfB1WhLN Qgo9LcsxbHAZg4kMuSkdhhWlARF7f5zK+xIHN4phyT1xlNK7JoiRV77jBU6DpDRWYoAqFob LVL93JJZy5A1Bqd9jGuUpbz75VzafntOcPeWtHHIH+9UUojlo6+XR6prj5+4BTFujqi5bi+ 1pmWvkhYJhiR24yiR05IQ== X-UI-Out-Filterresults: notjunk:1; Subject: Re: [Caml-list] constructor disambiguation for gadts On Tue, Oct 07, 2014 at 12:14:01PM -0400, Milan Stanojevi?? wrote: > I was wondering what are technical difficulties that prevent > constructor disambiguation for GADTs? > > I got an interesting error today, where it is clear that compiler > knows the type but because it is GADT it is still asking me to qualify > the constructor. > > Here is the simple example. > module A : sig > type _ t = > | I : int t > | S : string t > end = struct > type _ t = > | I : int t > | S : string t > end > > let add : type a . a A.t -> a -> a -> a = > fun w a1 a2 -> > match w with > | I -> a1 + a2 > | S -> String.concat "" [a1; a2] > ;; > > I get File "foo.ml", line 14, characters 6-7: > Error: The GADT constructor I of type A.t must be qualified in this pattern. > > I'm not sure what extra information I'm giving to the type checker by > qualifying the constructor. Shouldn't that be A.I and A.S? You didn't open module A. MfG Goswin