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 ABB267EEFA for ; Tue, 10 Nov 2015 11:55:19 +0100 (CET) IronPort-PHdr: 9a23:fSUIuhzSu3qXf1LXCy+O+j09IxM/srCxBDY+r6Qd0OoUIJqq85mqBkHD//Il1AaPBtWGra4ZwLOG+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStOU05n8jrD60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYCgJ45jCsRDCS0Oh/HoHWWVexhNMCgnDqh/gX4z6sgP+u/p81ijcNsrzG/R8Uj2n6+JvSQT0oCYBLT8wtm/N2eJqi6cOmhWkrh15i6Tdeo2SKbIqZKTYdNIcbWFbT95NUDdMBJixKYAICrxSbq5js4Dhqg5W/lOFDg62Cbaqk2cQiw== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=romain@cryptosense.com; spf=None smtp.mailfrom=romain@cryptosense.com; spf=None smtp.helo=postmaster@16.mo4.mail-out.ovh.net Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of romain@cryptosense.com) identity=pra; client-ip=188.165.55.104; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="romain@cryptosense.com"; x-sender="romain@cryptosense.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of romain@cryptosense.com) identity=mailfrom; client-ip=188.165.55.104; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="romain@cryptosense.com"; x-sender="romain@cryptosense.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@16.mo4.mail-out.ovh.net) identity=helo; client-ip=188.165.55.104; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="romain@cryptosense.com"; x-sender="postmaster@16.mo4.mail-out.ovh.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CGAAArzEFWm2g3pbxexTSDPYJTAoE8PBABAQEBAQEBARABAQEBAQgJCwkhLoIugggBAQQjBBFAEQsYAgIFFgsCAgkDAgECAUUGAQwIAoguAbFokF8BAQgCIYEBiSiBKYQpg0yBRAEElkiOBJtoOII8FgeBV4YfAQEB X-IPAS-Result: A0CGAAArzEFWm2g3pbxexTSDPYJTAoE8PBABAQEBAQEBARABAQEBAQgJCwkhLoIugggBAQQjBBFAEQsYAgIFFgsCAgkDAgECAUUGAQwIAoguAbFokF8BAQgCIYEBiSiBKYQpg0yBRAEElkiOBJtoOII8FgeBV4YfAQEB X-IronPort-AV: E=Sophos;i="5.20,270,1444687200"; d="scan'208";a="153344352" Received: from 16.mo4.mail-out.ovh.net ([188.165.55.104]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-GCM-SHA384; 10 Nov 2015 11:55:19 +0100 Received: from mail170.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo4.mail-out.ovh.net (Postfix) with SMTP id 87C931011802 for ; Tue, 10 Nov 2015 11:55:18 +0100 (CET) Received: from localhost (HELO queueout) (127.0.0.1) by localhost with SMTP; 10 Nov 2015 12:55:18 +0200 Received: from alille-655-1-132-116.w83-198.abo.wanadoo.fr (HELO ?192.168.1.15?) (romain@bardou.fr@83.198.207.116) by ns0.ovh.net with SMTP; 10 Nov 2015 12:55:17 +0200 To: Alain Frisch , caml-list@inria.fr 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> <0F7D3B1B3C4B894D824F5B822E3E5A172CE3ED02@IRSMSX102.ger.corp.intel.com> <5641C62C.9000606@cryptosense.com> <5641CA8E.4060909@lexifi.com> From: Romain Bardou Message-ID: <5641CD13.1080900@cryptosense.com> Date: Tue, 10 Nov 2015 11:55:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.3.0 MIME-Version: 1.0 In-Reply-To: <5641CA8E.4060909@lexifi.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Ovh-Tracer-Id: 14777717754210284064 X-Ovh-Remote: 83.198.207.116 (alille-655-1-132-116.w83-198.abo.wanadoo.fr) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekhedrgeehucetufdoteggodftvfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeekhedrgeehucetufdoteggodftvfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Validation-by: romain@cryptosense.com Subject: Re: [Caml-list] Newbie comment on constructor syntax On 10/11/2015 11:44, Alain Frisch wrote: > On 10/11/2015 11:25, Romain Bardou wrote: >> In the Mantis thread I proposed that #C or (C) would be the curried >> version of constructor C. > > If we go in the direction of making n-ary constructors behave as > constructor taking a tuple (at the expression level) then it seems > confusing that #C would mean something different for: > > type t = A of int * int > > and for: > > type t = A of (int * int) > > Moreover, I'm not sure about the benefit: how often do you need to > partially apply a constructor? And it's easy to define manually the > helper function (let a x y = A (x, y)) if needed. I don't think adding > dedicated syntax is justified here. > > Andreas suggested that a non-constant unapplied constructor would be > interpreted as a function (i.e. just A would be interpreted as (fun x -> > A x)). This would allow writing for instance "List.map Some l", and > have the nice consequence that "Some e" becomes equivalent to "(Some) > e". The only drawback I can think of with this idea is less useful > error locations when changing a constant constructor into a non-constant > one. > > Alain > That #C would mean something different for the definitions is an issue with the syntax and the semantics of constructor definitions I believe, which is already rather confusing :) That being said it's true that most of the time when I use a constructor as a function, the constructor has arity 1. In fact, most of the time it is Some. Cheers, -- Romain Bardou