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 10B2C7FD1D for ; Thu, 5 Nov 2015 03:10:24 +0100 (CET) IronPort-PHdr: 9a23:Ou2ezhdBLEYM2UIGMabM7N9ZlGMj4u6mDksu8pMizoh2WeGdxc6zZR7h7PlgxGXEQZ/co6odzbGG7ua7ACdcvd6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDvvcaKKFkUzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IeezAcq85Vb1VCig9eyBwvZWz9EqLcQzaz2AcU34W2jNHChLa5RWyCp7+uzHlv+4kiXbHFcLzRLEwHz+l6vE4ZgXvjXIlPjUg7WzMwuN5lrharw+s70hwypTOYY6IOdJ7d7/dO9UTSm1QV4NMESVKRIGkOdhcR9EdNPpV+tGu72AFqgGzUEz1XLvi Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jacques.garrigue@gmail.com; spf=Pass smtp.mailfrom=jacques.garrigue@gmail.com; spf=None smtp.helo=postmaster@mail-pa0-f48.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of jacques.garrigue@gmail.com) identity=pra; client-ip=209.85.220.48; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="jacques.garrigue@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of jacques.garrigue@gmail.com designates 209.85.220.48 as permitted sender) identity=mailfrom; client-ip=209.85.220.48; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="jacques.garrigue@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-pa0-f48.google.com) identity=helo; client-ip=209.85.220.48; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="jacques.garrigue@gmail.com"; x-sender="postmaster@mail-pa0-f48.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CGAAAcujpWlDDcVdFehA5vrjmRQ4V5gUM7EQEBAQEBAQEBEAEBAQEHCwsJHzCCLoIIAQEEEigGATgBAwwBBQUYLjQBBQEcBjWHdwMRAQWjHoExPjGQK4cqJw1Hg3UBAQEBBgEBAQEBAQEWAQUOiFaCboRZg0uBFAWOEIg4hR2IBokLEJFZNoEXN2aBSoIPY4U0AQEB X-IPAS-Result: A0CGAAAcujpWlDDcVdFehA5vrjmRQ4V5gUM7EQEBAQEBAQEBEAEBAQEHCwsJHzCCLoIIAQEEEigGATgBAwwBBQUYLjQBBQEcBjWHdwMRAQWjHoExPjGQK4cqJw1Hg3UBAQEBBgEBAQEBAQEWAQUOiFaCboRZg0uBFAWOEIg4hR2IBokLEJFZNoEXN2aBSoIPY4U0AQEB X-IronPort-AV: E=Sophos;i="5.20,245,1444687200"; d="scan'208";a="152689940" Received: from mail-pa0-f48.google.com ([209.85.220.48]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 05 Nov 2015 03:10:23 +0100 Received: by pasz6 with SMTP id z6so73189406pas.2 for ; Wed, 04 Nov 2015 18:10:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gm1HeS1Nli8AxbOqOTuJJTfDWX/kp4lAuM2aSkz3c5Q=; b=BQxgPVXwSs/OhazZlM3fYk8dyBn5gUln925exLV+VrDFniOWnxtE26zEhRH22Eoad4 IeQHznu97ZWDqcaL3HUPMzsNDVEpwR9SAviBRwSKVorT7Pnilz+kCDUrrLbA7//SSB7n /R/57IHi963idyIgSbekcMSLqBq8qlYFdUCgpA1nq2sLFC3dRZKZXFNoSNlZ0eLy3liK /elr6v0ZcboSf8BEuL/Bk0MSMZ3FQR2k536PCPYvPa3chg7Wgg3bgNfgPSWt6bVWWt2G SF9RUxYorWjwBQggEt8WSzZk3tPqURaZu2elZyIDPGlhtQ1fiIce83jVEdMoo29Eg48M 4NIA== X-Received: by 10.67.1.170 with SMTP id bh10mr6122347pad.17.1446689421364; Wed, 04 Nov 2015 18:10:21 -0800 (PST) Received: from [192.168.4.159] ([150.100.253.2]) by smtp.gmail.com with ESMTPSA id st5sm4452630pab.42.2015.11.04.18.10.18 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 04 Nov 2015 18:10:19 -0800 (PST) Sender: Jacques Garrigue Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Content-Type: text/plain; charset=us-ascii From: Jacques Garrigue In-Reply-To: Date: Thu, 5 Nov 2015 11:10:21 +0900 Cc: OCaml Mailing List Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Ashish Agarwal X-Mailer: Apple Mail (2.2104) Subject: Re: [Caml-list] substituting recursive types inside a signature On 2015/11/03 05:01, Ashish Agarwal wrote: >=20 > $ cat foo.ml > module M =3D struct > type t =3D A | B of u > and u =3D C of t > end >=20 > module type N =3D sig > include module type of M > with type t =3D M.t > and type u =3D M.u > end >=20 > $ ocamlc -c foo.ml > File "foo.ml", line 8, characters 9-21: > Error: This variant or record definition does not match that of type M.t > The types for field B are not equal. >=20 > I guess the "and" in the constraint doesn't make the constraints mutually= recursive, so what does it do? with constraints are handled incrementally. I.e., the code you wrote is exa= ctly equivalent to: include (((module type of M) with type t =3D M.t) with type u =3D M.u) It has always been that way. An interesting question is whether we could ac= tually delay the checking to after applying all the constraints. This would be a non-trivial change. Jacques Garrigue=