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 C76687F02D for ; Tue, 7 Oct 2014 18:14:43 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of milanst@gmail.com) identity=pra; client-ip=209.85.223.170; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="milanst@gmail.com"; x-sender="milanst@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of milanst@gmail.com designates 209.85.223.170 as permitted sender) identity=mailfrom; client-ip=209.85.223.170; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="milanst@gmail.com"; x-sender="milanst@gmail.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@mail-ie0-f170.google.com) identity=helo; client-ip=209.85.223.170; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="milanst@gmail.com"; x-sender="postmaster@mail-ie0-f170.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AggCAGMQNFTRVd+qm2dsb2JhbABfg2FYBIJ/yXuIXggWAREBAQEBAQYLCwkULIQcEQQZARseAxIQDwImAiQBEQEFARYMNYgHAQMRnWSDHW6LMIFygxCIIwoZJw1nhh0BBQ6BHpIWgVQFljSHDpQWGCmFMCEvgkoBAQE X-IPAS-Result: AggCAGMQNFTRVd+qm2dsb2JhbABfg2FYBIJ/yXuIXggWAREBAQEBAQYLCwkULIQcEQQZARseAxIQDwImAiQBEQEFARYMNYgHAQMRnWSDHW6LMIFygxCIIwoZJw1nhh0BBQ6BHpIWgVQFljSHDpQWGCmFMCEvgkoBAQE X-IronPort-AV: E=Sophos;i="5.04,671,1406584800"; d="scan'208";a="82313447" Received: from mail-ie0-f170.google.com ([209.85.223.170]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 07 Oct 2014 18:14:43 +0200 Received: by mail-ie0-f170.google.com with SMTP id rd18so5727270iec.1 for ; Tue, 07 Oct 2014 09:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=FC5EC4SMdTxNAqcIyT8JWupCqS4L3OAR1yP87ljf6eg=; b=G32CbJWzf1guVV1xdrc6emqKfsoqxzGShVk94Jm4MsyRYE5yNzuQL4QejVkTkYUWpq rFMI8eVz/XGUZ+BMKrn5ldKJdqf4PxS5sY9ueEZwhAcZFaHWSky8BMblqS7ZDhDXw/Kk rotUUFYrI0DLL2kcIH8w0NodFoOSJbYJUG5ULN/66RalZa8QWqGeZddhsyPOiFLFkO99 niwxNIx6iBjrzS6+Xc/WxRHbgeQYvKjccq/0bfpce3KBkSIMx61hDS5o0/8f80xrcnAP fIh6n/LSsQtQA6hyqLCk/a5g4CmUJWRZ6/JXnRJ1OyA8ZqhtZ9FY9Kl6cGa/Z3TY/t3l cSpw== X-Received: by 10.42.137.129 with SMTP id y1mr6093900ict.40.1412698482036; Tue, 07 Oct 2014 09:14:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.64.114.38 with HTTP; Tue, 7 Oct 2014 09:14:01 -0700 (PDT) From: =?UTF-8?Q?Milan_Stanojevi=C4=87?= Date: Tue, 7 Oct 2014 12:14:01 -0400 Message-ID: To: Caml List Content-Type: text/plain; charset=UTF-8 Subject: [Caml-list] constructor disambiguation for gadts 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.