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 864087FD92 for ; Fri, 10 Jun 2016 22:18:36 +0200 (CEST) IronPort-PHdr: 9a23:tCdAuxNHcYsqiJJD09Il6mtUPXoX/o7sNwtQ0KIMzox0Kfn6rarrMEGX3/hxlliBBdydsKIVzbWJ+Pm8AyQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTmkb/tsMSPOU1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4gyLeVhOC7WcwVWAfkxwAQ1SUrUKyYpCkiarwv/Fh2SScCu33S7w5Qzm4p/NQRRXhkzsGOjh/0GDRhsFqgbhzoRS7phU5zZSCJMmePf96Nr7GcMkBDT5KV8NVEihAGZ+Ubo0VDuNHM/wO/KfnoF5bghK0HwihAKvUwT9FnHLslfk12u47EAzCmhcrH98UvW78o9D8NaNUWuewmvqbhQ7fZu9bjG+uoLPDdQos9LTRBL8= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-it0-f65.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.65; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.65 as permitted sender) identity=mailfrom; client-ip=209.85.214.65; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@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-it0-f65.google.com) identity=helo; client-ip=209.85.214.65; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-it0-f65.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CCBABPIFtXa0HWVdFegz5WfQaqCZEXgXoihXUCgSQHOhIBAQEBAQEBARELCwwIHzGCMIIVAQEBAwESER0BGxIMAwELBgULDQICCR0CAiEBAREBBQEKEgYBEhIQh3MBAw8IDp9LgTE+MYs7gWqCWQWHNgoZJwMKUoMsAQEBAQYBAQEBARoCBhBxhSaETYJDhH6CWgEEhkUMkVo0gViELIYqgXqCN4xph36GLhIegQ8lA4ImP4FRIDKKCAEBAQ X-IPAS-Result: A0CCBABPIFtXa0HWVdFegz5WfQaqCZEXgXoihXUCgSQHOhIBAQEBAQEBARELCwwIHzGCMIIVAQEBAwESER0BGxIMAwELBgULDQICCR0CAiEBAREBBQEKEgYBEhIQh3MBAw8IDp9LgTE+MYs7gWqCWQWHNgoZJwMKUoMsAQEBAQYBAQEBARoCBhBxhSaETYJDhH6CWgEEhkUMkVo0gViELIYqgXqCN4xph36GLhIegQ8lA4ImP4FRIDKKCAEBAQ X-IronPort-AV: E=Sophos;i="5.26,451,1459807200"; d="scan'208";a="180893347" Received: from mail-it0-f65.google.com ([209.85.214.65]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Jun 2016 22:18:09 +0200 Received: by mail-it0-f65.google.com with SMTP id i6so653017ith.0; Fri, 10 Jun 2016 13:18:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=xSOZOjQIsCwkdRk+uo9c5V8iiQojnIU5dmTGxDm7E4A=; b=RpOY++y5Dwtqsuwmr0VUBXDfweUXI0zRvSb9vYVv8i722bnkAZKT3Ygtn58u/zJ1GB VkSPOTY99jALCrHQIQGz00DPjbfTVy5bQuviS9XxdpKRSn6w5hK3OiYApj/UTU+wghte 1+ojDkoDtd9HxPEBR13xBDTtN19WN81L/TEIf3cwGlK5ysaENjXpwnueFg7qt1PBsGAU bnhXebLE2ZWYMMCYyRl7uBq9KLKso92bUduG38da7Ejp7jdbYwlYDNUG9nfaZYgEM41h i7gIlBv4H9KdY7HYn9ykgUqvqjCJWw99lZjdvgle3Q6DU6FbnCkkm50QKUMKltzA1szq pKCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=xSOZOjQIsCwkdRk+uo9c5V8iiQojnIU5dmTGxDm7E4A=; b=YmSkCLqJwY1cxZpGtAzzMRQi4Ys/yrHaDLTvmP7Hlr+CnInlxDZ6+yhZcl/cfN0QCr sRPBk9w9WdIcnx4ku1HMMpObAxMeKzBFTvdpPj5s0223y5WFG/3Uif0yMmkVWYzhKST/ GsBagK2malJWzEJm5V+uVpmJzKrG+LB2Pp4mBZIx/iTcMM9ubQ4uAlS6J9nBiPShr0+t 1YhAf9AuuVkIh/JZGM4Uf2SM3g5WNEzrCAyPduVvNTeoO4mxoPco+anatEdrKi4b8ebk m7hauZSITDEa+n5xqzX0rMZtvCSsZAuTsjK/yviPtXEcophV416swfYD02Z5tvlUrhPl uDcg== X-Gm-Message-State: ALyK8tLV9GnzezWSbAxjWaRr9TqMyoKlGavK32YJR5eaojKFfy+C0Mp/DF2y6dSpSuXc2blVPxp3zRh91nzPuw== X-Received: by 10.36.3.7 with SMTP id e7mr1428375ite.15.1465589887581; Fri, 10 Jun 2016 13:18:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.89.195 with HTTP; Fri, 10 Jun 2016 13:17:28 -0700 (PDT) In-Reply-To: References: <20160610200021.GA2068@pl-59055.rocqadm.inria.fr> From: Gabriel Scherer Date: Fri, 10 Jun 2016 16:17:28 -0400 Message-ID: To: =?UTF-8?Q?S=C3=A9bastien_Hinderer?= , caml users Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] Error: The type abbreviation t is cyclic while defining submodules > not in equations such as "with type t =3D t" > which are a different construct, interpreted recursively There is a typo above, I meant to say that such type constraints are *not* recursive, and thus do not need a nonrec construction. On Fri, Jun 10, 2016 at 4:05 PM, Gabriel Scherer wrote: > P.S.: Note that "nonrec" is only in definitions (struct .. end) and > signatures (sig .. end), not in equations such as "with type t =3D t" > which are a different construct, interpreted recursively -- not the > best choice for consistency, but well. > > On Fri, Jun 10, 2016 at 4:03 PM, Gabriel Scherer > wrote: >> This is >> >> type nonrec t =3D t >> >> which has been introduced in 4.02, after some years of internal usage >> of (a syntax preprocessor implementing) it internally in Jane Street. >> >> On Fri, Jun 10, 2016 at 4:00 PM, S=C3=A9bastien Hinderer >> wrote: >>> Dear all, >>> >>> Assume the following code in a file points.ml: >>> >>> type t =3D float * float >>> >>> let compare =3D Pervasives.compare >>> >>> (* Other functions on points *) >>> >>> module OrderedPoints : Set.OrderedType with type t =3D t =3D struct >>> type t =3D t >>> let compare =3D compare >>> end >>> >>> module PointSet : Set.S with type t =3D t =3D Set.Make(OrderedPoints) >>> >>> >>> The line >>> type t =3D t >>> yields the above mentionned error. >>> >>> Is there a way to let the compiler know that the t appearing after the >>> "=3D" sign refers to the type defined at points.ml top level? >>> >>> Thanks! >>> >>> S=C3=A9bastien. >>> >>> -- >>> Caml-list mailing list. Subscription management and archives: >>> https://sympa.inria.fr/sympa/arc/caml-list >>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners >>> Bug reports: http://caml.inria.fr/bin/caml-bugs