From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 7C4227FC22 for ; Fri, 13 Feb 2015 22:41:02 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of ceastlund@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="ceastlund@janestreet.com"; x-sender="ceastlund@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of ceastlund@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="ceastlund@janestreet.com"; x-sender="ceastlund@janestreet.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@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="ceastlund@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D0AABXbt5UnHDIaSZbhDIEgn7GMAdDAQEBAQEBEAEBAQEBBhYJQoQlER0BATgYBgc3AiQSAQUBPRqICwOhD5BPPjGKPnCEYgEFkhkMARkGCpIjDC8RgTGKPI4ykTsSI4EVhC5RgkMBAQE X-IPAS-Result: A0D0AABXbt5UnHDIaSZbhDIEgn7GMAdDAQEBAQEBEAEBAQEBBhYJQoQlER0BATgYBgc3AiQSAQUBPRqICwOhD5BPPjGKPnCEYgEFkhkMARkGCpIjDC8RgTGKPI4ykTsSI4EVhC5RgkMBAQE X-IronPort-AV: E=Sophos;i="5.09,573,1418079600"; d="scan'208";a="100019234" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Feb 2015 22:41:01 +0100 Received: from tot-qpr-mailcore2.delacy.com ([172.27.56.106] helo=tot-qpr-mailcore2) by mxout1.mail.janestreet.com with smtp (Exim 4.82) (envelope-from ) id 1YMNyt-00032I-LD for caml-list@inria.fr; Fri, 13 Feb 2015 16:40:59 -0500 X-JS-Flow: external Received: by tot-qpr-mailcore2 with JS-mailcore (0.1) (envelope-from ) id BU3m9r-AAACev-UI; 2015-02-13 16:40:59.645221-05:00 Received: from mail-ig0-f170.google.com ([209.85.213.170]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1YMNyt-00025v-F7 for caml-list@inria.fr; Fri, 13 Feb 2015 16:40:59 -0500 Received: by mail-ig0-f170.google.com with SMTP id l13so18489448iga.1 for ; Fri, 13 Feb 2015 13:40:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:from:date:message-id:subject:to:content-type; bh=lEiKpWItv43vDGQSQng8hc5pYDaUOb8jLK1Aq9e7JQw=; b=cpU8OSW3wl0NQqveGCSz1PcYCU49oEljiw/+B2dedG14bGdoWCthFV6xj4qKec4GBg nX7GVS1UXgIFehzdo9RrGD4arMkILsqc3nOW0baUMEXPctclcjtZpCXQvMiGFvaZwq4E t0wie4SmHihDuG0g0MjS+bM0g+SpxlmOnB7Ok= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=lEiKpWItv43vDGQSQng8hc5pYDaUOb8jLK1Aq9e7JQw=; b=hTotvGyLFFAyu0pU6eS+48QxWPnQVSyFnyQVL2lnxfgzE3knodRG5kSpVr7vzNV7r7 wKxPfqjgr8ccTYV2PunEtWU3o+IvJVz6whWgANU9P7BTGUVqL0evXIyYV37KZ+B9oYik YXP59QBhBSHq2iayuB+VvqhjS9c4tWSzCbVpjTcpTTdpmOWQBUdrTl0SQ4M+dH9oNPja txXrJ/8BPYuH4qOjIrL5NVQARCuvqoIULOM+KpvjHHSiThJ+eE4OBg+J24yKhz6jDSwY xYOohdDdnyCLjEXJqkpLYbths5lDIxGQK6sPE9myAOEmiZ9+sePGDpB1/+VMms1I1oAx 4jqQ== X-Gm-Message-State: ALoCoQk9YNAoQAGbaKM55m9CvBkMYOWpsiSpf7TMTIVrKA5ka/3sAcshC9Q34HWsgzpjepNiri3ka2hhwpo87V2jPUNsQXO5IO8aE2YH6qYuhqPCHR7DM2hiZl6R4JRq0tmAkvL1R65O X-Received: by 10.50.66.243 with SMTP id i19mr6614435igt.7.1423863659140; Fri, 13 Feb 2015 13:40:59 -0800 (PST) X-Received: by 10.50.66.243 with SMTP id i19mr6614431igt.7.1423863659053; Fri, 13 Feb 2015 13:40:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.166.212 with HTTP; Fri, 13 Feb 2015 13:40:18 -0800 (PST) From:Carl Eastlund Date: Fri, 13 Feb 2015 16:40:18 -0500 Message-ID: To:caml-list@inria.fr Content-Type: multipart/alternative; boundary=047d7bdc11d69b5c94050eff1740 X-JS-Processed-by: mailcore Subject: [Caml-list] Weird type error involving 'include' and applicative functors --047d7bdc11d69b5c94050eff1740 Content-Type: text/plain; charset=UTF-8 This seems to be a compiler bug, but let me know if I've missed something. The behavior I see is that Make_ok1 and Make_ok2 compile fine, but the very similar functor Make_bad does not. I get this compile error: ======================================== Error: Signature mismatch: Modules do not match: sig module C : sig module T : sig end type t = Make(T).t end module T = C.T type t = Make(T).t end is not included in sig type t module C : sig type t = t end end In module C: Modules do not match: sig module T : sig end type t = Make(T).t end is not included in sig type t = C.t end In module C: Type declarations do not match: type t = Make(T).t is not included in type t = t ======================================== And here is the code: ======================================== module type S = sig type t end module Make (M : sig end) : S = struct type t end module Make_ok1 (M : sig end) : sig type t module A : S with type t = t end = struct module A = struct include Make (struct end) end include A end module Make_ok2 (M : sig end) : sig type t module B : S with type t = t end = struct module T = struct end module B = struct include Make (T) end include B end module Make_bad (M : sig end) : sig type t module C : S with type t = t end = struct module C = struct module T = struct end include Make (T) end include C end ======================================== -- Carl Eastlund --047d7bdc11d69b5c94050eff1740 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This seems to be a compiler bug, but let me know if I'= ve missed something.=C2=A0 The behavior I see is that Make_ok1 and Make_ok2= compile fine, but the very similar functor Make_bad does not.=C2=A0 I get = this compile error:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D

=C2=A0 =C2=A0 =C2=A0 Error: Signatu= re mismatch:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Modu= les do not match:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0sig
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0module C : sig module T : sig =C2=A0end type t =3D Make(T).t e= nd
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= module T =3D C.T
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0type t =3D Make(T).t
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0end
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0is not included in
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0sig type t module C : sig type t =3D t end end
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0In module C:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Modules do not match:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sig module T = : sig =C2=A0end type t =3D Make(T).t end
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0is not included in
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0sig type t =3D C.t end
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0In module C:
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Type declarations do not match:
=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0type t =3D Make= (T).t
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is not incl= uded in
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ty= pe t =3D t

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D

And here is the code:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

module type S =3D sig type t end
module Make (M : s= ig end) : S =3D struct type t end

module Make_ok1 = (M : sig end) : sig

=C2=A0 type t
=C2=A0= module A : S with type t =3D t

end =3D struct

=C2=A0 module A =3D struct
=C2=A0 =C2=A0 in= clude Make (struct end)
=C2=A0 end
=C2=A0 include A

end

module Make_ok2 (M : sig= end) : sig

=C2=A0 type t
=C2=A0 module = B : S with type t =3D t

end =3D struct
<= br>
=C2=A0 module T =3D struct end
=C2=A0 module B =3D = struct
=C2=A0 =C2=A0 include Make (T)
=C2=A0 end
<= div>=C2=A0 include B

end

= module Make_bad (M : sig end) : sig

=C2=A0 type t<= /div>
=C2=A0 module C : S with type t =3D t

en= d =3D struct

=C2=A0 module C =3D struct
= =C2=A0 =C2=A0 module T =3D struct end
=C2=A0 =C2=A0 include Make = (T)
=C2=A0 end
=C2=A0 include C

end

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D

--
Carl Eastlund
--047d7bdc11d69b5c94050eff1740--