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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 898CC7EEFA for ; Fri, 13 Nov 2015 14:56:50 +0100 (CET) IronPort-PHdr: 9a23:v8/YqBUPvea45m2SATHDMHUsOirV8LGtZVwlr6E/grcLSJyIuqrYZheBt8tkgFKBZ4jH8fUM07OQ6PC9HzFZqsrQ+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8CVPlwD2Gv1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu2pN5g/GLdRCTBjN2Eu+OXqswPCRE2B/CgySGITx1BtGU6NzBzgRN255i77rfZwwimXJ9feQ6o5VDKv8+FnRUm72288Kzcl/TSP2YRLh6VBrUf5qg== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=misterherr@freenet.de; spf=None smtp.mailfrom=misterherr@freenet.de; spf=None smtp.helo=postmaster@mout3.freenet.de Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of misterherr@freenet.de) identity=pra; client-ip=195.4.92.93; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="misterherr@freenet.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of misterherr@freenet.de) identity=mailfrom; client-ip=195.4.92.93; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="misterherr@freenet.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout3.freenet.de) identity=helo; client-ip=195.4.92.93; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="misterherr@freenet.de"; x-sender="postmaster@mout3.freenet.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B5AAAR60VWnF1cBMNegw/CJ4M9glMCgTo8EAEBAQEBAQEBEAEBAQEBBg0JCSEugi2CCAEBBCNVEQsYAgIFFgsCAgkDAgECAUUTCAEBiBQBFgMBsDiLGwmBMgGDfwELIYEBilGEWU6CToFEBZZIAZY/BJMoOII8FgeBV4YuAQEB X-IPAS-Result: A0B5AAAR60VWnF1cBMNegw/CJ4M9glMCgTo8EAEBAQEBAQEBEAEBAQEBBg0JCSEugi2CCAEBBCNVEQsYAgIFFgsCAgkDAgECAUUTCAEBiBQBFgMBsDiLGwmBMgGDfwELIYEBilGEWU6CToFEBZZIAZY/BJMoOII8FgeBV4YuAQEB X-IronPort-AV: E=Sophos;i="5.20,287,1444687200"; d="scan'208";a="187392148" Received: from mout3.freenet.de ([195.4.92.93]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2015 14:56:50 +0100 Received: from [195.4.92.140] (helo=mjail0.freenet.de) by mout3.freenet.de with esmtpa (ID misterherr@freenet.de) (port 25) (Exim 4.85 #1) id 1ZxEqP-0006OT-Cs for caml-list@inria.fr; Fri, 13 Nov 2015 14:56:49 +0100 Received: from localhost ([::1]:57762 helo=mjail0.freenet.de) by mjail0.freenet.de with esmtpa (ID misterherr@freenet.de) (Exim 4.85 #1) id 1ZxEqP-0001Uq-8d for caml-list@inria.fr; Fri, 13 Nov 2015 14:56:49 +0100 Received: from mx9.freenet.de ([195.4.92.19]:40659) by mjail0.freenet.de with esmtpa (ID misterherr@freenet.de) (Exim 4.85 #1) id 1ZxEnD-00034N-OW for caml-list@inria.fr; Fri, 13 Nov 2015 14:53:31 +0100 Received: from [2001:6f8:1c00:fb::2] (port=42922 helo=suse132-intel.home.loc) by mx9.freenet.de with esmtpsa (ID misterherr@freenet.de) (TLSv1.2:DHE-RSA-AES128-SHA:128) (port 465) (Exim 4.85 #1) id 1ZxEnD-0000TG-Go for caml-list@inria.fr; Fri, 13 Nov 2015 14:53:31 +0100 To: caml-list@inria.fr References: <5645DC49.7050106@tu-berlin.de> <5645E255.5060900@freenet.de> From: "Mr. Herr" Message-ID: <5645EB59.8040505@freenet.de> Date: Fri, 13 Nov 2015 14:53:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originated-At: 2001:6f8:1c00:fb::2!42922 Subject: Re: [Caml-list] Cyclic type abbreviation On 13.11.2015 14:37, David Allsopp wrote: > Mr. Herr wrote: >> On 13.11.2015 13:49, Christoph H=C3=B6ger wrote: >>> Dear all, >>> >>> why is this type cyclic? >>> >>> type node =3D int * tree * tree >>> and tree =3D node option >>> >>> I cannot introduce a manifest for the option type, as there is no >>> Option module (why is that, btw?) - so I would assume option to be >>> special enough to be handled like any other algebraic data type. >> type 'a option =3D None | Some 'a >> >> no need for a module, just a simple type. Maybe you confound it with oth= er >> languages. >> >> And cyclic - well, the types are referring to each other. >> >> Summary: what is supposedly wrong with it? > I expect that what is wrong is that you can write: > > type node =3D int * tree * tree > and tree =3D Some of node > | None > > I don't know why you can't write [and tree =3D node option] instead. > > > Ah, did not see the problem at first sight... Maybe that is why people so often define their own empty element: # type node =3D Emptynode | Node of (int * node * node) ;; type node =3D Emptynode | Node of (int * node * node) # type node =3D Emptynode | Node of int * node * node ;; (* just had this p= arens discussion... *) type node =3D Emptynode | Node of int * node * node /Str.