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 B8ECD7EEFA for ; Mon, 9 Nov 2015 23:06:55 +0100 (CET) IronPort-PHdr: 9a23:nKhyFBVQqZ4apuIL3QuvYGwZA0HV8LGtZVwlr6E/grcLSJyIuqrYZxeHt8tkgFKBZ4jH8fUM07OQ6PC9HzBbqs/c6jgrS99laVwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfTR8Kum9IIPOlcP/j7n0oM2OJVkTz2PgO/tbF1afk0b4joEum4xsK6I8mFPig0BjXKBo/15uPk+ZhB3m5829r9ZJ+iVUvO89pYYbCf2pN4xxd7FTDSwnPmYp/4Wr8ECbFUrcrkcbB0ofmABJDgyN1xr6U438qGOuueN3wiiXOYvtRrA5Qzm4x6huQR7sziwAMmh9uEjRhtZ9hbkTmhW6vBZy2YGcNJuSL+F0c7nSVdYCRC9aQd0XUDZOVNCSdYwKWsMFNOde56fnpkAFrVPqDA2lBeWpxCVJnXT29ak3w+UvEEfN2wl2TIFGi2jdsNigbPRaauuy1qSdiGybN/4= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=alain.frisch@lexifi.com; spf=None smtp.mailfrom=alain.frisch@lexifi.com; spf=None smtp.helo=postmaster@mx30.yaziba.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=pra; client-ip=82.138.71.21; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=mailfrom; client-ip=82.138.71.21; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mx30.yaziba.net) identity=helo; client-ip=82.138.71.21; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="postmaster@mx30.yaziba.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ByAADnF0FWnBVHilJehA5wvkyBYyOFI0oCgUU6EgEBAQEBAQEBEAEBAQEBCAsJCSEugi6CCAEBBCMVQAEQCxgCAgUWCwICCQMCAQIBRQYBDAgBAYguCbECkGIBAQEBAQEEAQEBAQEegQGFU4R+h3WBRAWWSIUeiAmCJIZ5kyYCJwGCYoFehlcBAQE X-IPAS-Result: A0ByAADnF0FWnBVHilJehA5wvkyBYyOFI0oCgUU6EgEBAQEBAQEBEAEBAQEBCAsJCSEugi6CCAEBBCMVQAEQCxgCAgUWCwICCQMCAQIBRQYBDAgBAYguCbECkGIBAQEBAQEEAQEBAQEegQGFU4R+h3WBRAWWSIUeiAmCJIZ5kyYCJwGCYoFehlcBAQE X-IronPort-AV: E=Sophos;i="5.20,267,1444687200"; d="scan'208";a="186827294" Received: from mx30.yaziba.net ([82.138.71.21]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 09 Nov 2015 23:06:55 +0100 Received: from mta20.int.yaziba.net (unknown [217.117.151.14]) by mx30.yaziba.net (mx10.yaziba.net) with ESMTP id 9239F1A7590; Mon, 9 Nov 2015 23:06:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta20.int.yaziba.net (Postfix) with ESMTP id C235D1494DE; Mon, 9 Nov 2015 23:06:54 +0100 (CET) X-Virus-Scanned: amavisd-new at mta20.int.yaziba.net Received: from mta20.int.yaziba.net ([127.0.0.1]) by localhost (mta20.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 87ssyITqBWR2; Mon, 9 Nov 2015 23:06:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta20.int.yaziba.net (Postfix) with ESMTP id 9C47D149786; Mon, 9 Nov 2015 23:06:54 +0100 (CET) X-Virus-Scanned: amavisd-new at mta20.int.yaziba.net Received: from mta20.int.yaziba.net ([127.0.0.1]) by localhost (mta20.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Ef1gsXZ0excE; Mon, 9 Nov 2015 23:06:54 +0100 (CET) Received: from [192.168.1.21] (APuteaux-655-1-112-37.w83-204.abo.wanadoo.fr [83.204.235.37]) by mta20.int.yaziba.net (Postfix) with ESMTPSA id 5E37D1494DE; Mon, 9 Nov 2015 23:06:54 +0100 (CET) To: Gabriel Scherer , Andreas Rossberg References: <0F7D3B1B3C4B894D824F5B822E3E5A172CE3E070@IRSMSX102.ger.corp.intel.com> <87pozk6vjp.fsf@mid.deneb.enyo.de> <0F7D3B1B3C4B894D824F5B822E3E5A172CE3E747@IRSMSX102.ger.corp.intel.com> <56407297.2060309@frisch.fr> <564076EA.7020805@mpi-sws.org> <5640D8E0.6060102@lexifi.com> <5640E2EF.7070400@mpi-sws.org> Cc: caml users From: Alain Frisch Message-ID: <564118FD.5050804@lexifi.com> Date: Mon, 9 Nov 2015 23:06:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-DRWEB-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeekhedrfeelgdehkecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpjgetkgfkueetnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtjegrtddtfeejnecuhfhrohhmpeetlhgrihhnucfhrhhishgthhcuoegrlhgrihhnrdhfrhhishgthheslhgvgihifhhirdgtohhmqeenucffohhmrghinhepshhtrggtkhhovhgvrhhflhhofidrtghomhenucfrrghrrghmpehmohguvgepshhmthhpohhuth X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Newbie comment on constructor syntax On 09/11/2015 22:11, Gabriel Scherer wrote: > Yes, it is already problematic, and in fact I'm personally not > completely convinced by this feature -- Alain it "reduces bad > surprises for beginners", but I suspect that adding more magic in this > place could not actually help that much -- at least the current > semantic model is simple. Just to illustrate that the confusion related to n-ary constructors is real: http://stackoverflow.com/questions/3940345/defining-exceptions-with-tuple-as-argument http://stackoverflow.com/questions/10306733/ocaml-constructor-unpacking http://stackoverflow.com/questions/9774671/using-a-variant-type-constructor-with-just-one-tuple-value http://stackoverflow.com/questions/14818866/int-int-vs-int-int-in-ocaml-sum-type Now, it's not completely clear that the current proposal is enough to reduce significantly the confusion; one could argue that by hiding the difference between n-ary constructors and constructors with tuple arguments at the value level, one makes it harder for beginners to get the right mental model required to understand type inclusion ("type s = int * int;; type t = A of s" vs "type t = A of int * int"). -- Alain