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 4AB737ED1D for ; Tue, 13 Oct 2015 07:27:38 +0200 (CEST) IronPort-PHdr: 9a23:F3nVZRK4wnuFqoa6rtmcpTZWNBhigK39O0sv0rFitYgUL//xwZ3uMQTl6Ol3ixeRBMOAu64C27Cd6f26EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35jxh7r5ocCJKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46FppIZ8VvDxdqE8CLhZFygOMmYv5cStuwOQYxGI4y41WGkflh5BA0D+5R/0X5vwtCay4uN31CCeOcT2C6s9Vzqj46ZtRTfnjS4GM3gy92SB2Z84t75SvB/0/083+IXTeozAbPc= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=abdallah.saffidine@gmail.com; spf=Pass smtp.mailfrom=abdallah.saffidine@gmail.com; spf=None smtp.helo=postmaster@mail-wi0-f174.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of abdallah.saffidine@gmail.com) identity=pra; client-ip=209.85.212.174; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="abdallah.saffidine@gmail.com"; x-sender="abdallah.saffidine@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of abdallah.saffidine@gmail.com designates 209.85.212.174 as permitted sender) identity=mailfrom; client-ip=209.85.212.174; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="abdallah.saffidine@gmail.com"; x-sender="abdallah.saffidine@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-wi0-f174.google.com) identity=helo; client-ip=209.85.212.174; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="abdallah.saffidine@gmail.com"; x-sender="postmaster@mail-wi0-f174.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D4BgD+lBxWlK7UVdFdg0U1bgatAYR9i2GCExcBDYJuggp6A4E2BzwQAQEBAQEBAQEQAQEBAQcLCwkfMIIfgiARBBkBGx4DEhA3AiQBEQEFAVeHdgEDEg2ccYIIgTE+MYtJgWyCeYkHChknDVaEaQEFDoZniimCFwwvFIExBZYVeoQfiAGCIJIhhXgSI4EXESeCATsWB4FoKjOGcQEBAQ X-IPAS-Result: A0D4BgD+lBxWlK7UVdFdg0U1bgatAYR9i2GCExcBDYJuggp6A4E2BzwQAQEBAQEBAQEQAQEBAQcLCwkfMIIfgiARBBkBGx4DEhA3AiQBEQEFAVeHdgEDEg2ccYIIgTE+MYtJgWyCeYkHChknDVaEaQEFDoZniimCFwwvFIExBZYVeoQfiAGCIJIhhXgSI4EXESeCATsWB4FoKjOGcQEBAQ X-IronPort-AV: E=Sophos;i="5.17,676,1437429600"; d="scan'208";a="150346249" Received: from mail-wi0-f174.google.com ([209.85.212.174]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 13 Oct 2015 07:27:37 +0200 Received: by wicgb1 with SMTP id gb1so73619546wic.1 for ; Mon, 12 Oct 2015 22:27:37 -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=lTJ85GA2UqPK/oeIpdlrKXCl55Qh/LdiTspiy5j1vVM=; b=kuZVO6BLrJPDhflxMxzft2dMVzKsX/JM7EAhSZtN2rpi0d19+jg5U2FLIYGNj7m8DF nyUDuQ6+6cI1+jOqhdlaTnNLZyEq1pV2mu1vTwNKgahTg38UiKTqSUljDixqHwp6i4RD V3R57zGkcXcnDzhe74ehC72aYEHo9i8NNrMjVYyMcfqbU5tp5fzyoetnRZLT57vZsXh3 E3TZ8T2oG3hMwyZ9BnwGtHl0KgrYCQqX28t4a/slGW7wItFWsDIqeuJEP56iEM8tTqBu XJwQte7VCDdsyC5NF2RF6MbaWgpUkbFb+LO99MeFPCVBazpwLj1xFtZCyBAdU4UQopCE BpBA== X-Received: by 10.180.188.169 with SMTP id gb9mr19512778wic.72.1444714056974; Mon, 12 Oct 2015 22:27:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.27.108.71 with HTTP; Mon, 12 Oct 2015 22:27:17 -0700 (PDT) From: Abdallah Saffidine Date: Tue, 13 Oct 2015 16:27:17 +1100 Message-ID: To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=001a11c26bb82b06da0521f5b4b7 X-Validation-by: abdallah.saffidine@gmail.com Subject: [Caml-list] How to use GADTs across modules in OCaml without raising warnings? --001a11c26bb82b06da0521f5b4b7 Content-Type: text/plain; charset=UTF-8 Hi all, I am reposting this SO question . I suspect there might be a bug in the implementation of Warning 8. Thanks, Abdallah I have two files: gadt1.ml and gadt2.ml and the second depends on the first. gadt1.ml: type nevertype _ t1 = A1 : never t1 | B1 : bool t1type _ t2 = A2 : string t2 | B2 : bool t2let get1 : bool t1 -> bool = function B1 -> truelet get2 : bool t2 -> bool = function B2 -> true gadt2.ml: let get1 : bool Gadt1.t1 -> bool = function Gadt.B1 -> truelet get2 : bool Gadt1.t2 -> bool = function Gadt.B2 -> true when I compile using ocaml 4.02.3 (ocamlbuild gadt2.native), I get a warning 8 about the function Gadt2.get1 not being exhaustive. I am quite puzzled that Gadt2.get1 raises a warning while Gadt1.get1 and Gadt2.get2 don't. My assumption was that the empty type never cannot be equal to bool so Gadt2.get1 should not raise a warning. On the other hand, if I call Gadt2.get1 with argument A1, I get a type error (as desired). Is the warning expected behaviour or a bug? What did I miss? --001a11c26bb82b06da0521f5b4b7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all,

I am reposting this SO question. I suspect there might be= a bug in the implementation of Warning 8.

Thanks,
Ab= dallah

I have two files: ga= dt1.ml and gadt2.ml and the second depe= nds on the first.

gadt1.ml:

type never
type _ t1 =3D A1 : never  t1 | B1=
 : bool t1
type _ t2 =3D A2 : string t2 | B2=
 : bool t2
let get1 : bool t1 -> bool =3D=
 function B1 -> true=

let get2 : bool t2 -> bool =3D=
 function B2 -> true=

gadt2.ml:

let get1 : bool Gadt1=
.t1 -><=
/span> bool =3D function Gadt=
.B1 -><=
/span> true
let get2 : bool Gadt1.<=
span class=3D"">t2 -> bo=
ol =3D function Gadt.=
B2 -> <=
/span>true

when I compile using ocaml 4.02.3 (ocamlbuild gadt2.native)= , I get a warning 8 about the function Gadt2.get1 not being exhaustive. I a= m quite puzzled that Gadt2.get1 raises a warning while G= adt1.get1 and Gadt2.get2 don't.

My assumption was that the empty type never cannot be equal= to bool so Gadt2.get1 should not raise a warning= . On the other hand, if I call Gadt2.get1 with argument = A1, I get a type error (as desired). Is the warning expected behavio= ur or a bug? What did I miss?


--001a11c26bb82b06da0521f5b4b7--