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 5158A7EEFA for ; Mon, 9 Nov 2015 19:16:21 +0100 (CET) IronPort-PHdr: 9a23:KnXq8BJT53rgBHJhV9mcpTZWNBhigK39O0sv0rFitYgVLvXxwZ3uMQTl6Ol3ixeRBMOAu68C17Gd6vi/EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35nxi7v5osWMKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46Fp34d6XK77Z6U1S6BDRHRjajhtpZ7djgTYVQaE+lcbV2wXlFIIX1mEv1nGWcLeuyHgt+d5kBKRPcDsQKp8DTur5b1qRRuukywHOiQ06knYj8VxiORQpxf341RWx4fVZsm7LvtldaOVKdoeTGtHGMhLVjdKAqu4YpsOAetHNuFd+drTvVwL+DK4CROhDfin8DhTnXX7x6Jyh/4mChrM0RYvN9cWsTHPs86zM70dB7PmhJLUxCnOOqsFkQz275LFJ1V8+Pw= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=rossberg@mpi-sws.org; spf=Pass smtp.mailfrom=rossberg@mpi-sws.org; spf=None smtp.helo=postmaster@hera.mpi-klsb.mpg.de Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of rossberg@mpi-sws.org) identity=pra; client-ip=139.19.1.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rossberg@mpi-sws.org"; x-sender="rossberg@mpi-sws.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of rossberg@mpi-sws.org designates 139.19.1.49 as permitted sender) identity=mailfrom; client-ip=139.19.1.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rossberg@mpi-sws.org"; x-sender="rossberg@mpi-sws.org"; 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@hera.mpi-klsb.mpg.de) identity=helo; client-ip=139.19.1.49; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="rossberg@mpi-sws.org"; x-sender="postmaster@hera.mpi-klsb.mpg.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BwAAD94UBWhDEBE4tehA5vrm+RQCGFbwKBfxABAQEBAQEBARABAQEKBwQJCSEugi6CBwEBAQMBEhEEEQgBASwKAQEECwsYAgIFBBILAgIJAwIBAgEjBQsSBgEMBgIBAQ4Qh3cDCggNonyBMT4xildxhGMBBYcZA4RRAQEBAQEBAQEBAQEBAQEBARcGgQGKUYd1gUSGEAyQMYUeiWRJg3eCfgSPNoNyOIIvI4FecYVmAQEB X-IPAS-Result: A0BwAAD94UBWhDEBE4tehA5vrm+RQCGFbwKBfxABAQEBAQEBARABAQEKBwQJCSEugi6CBwEBAQMBEhEEEQgBASwKAQEECwsYAgIFBBILAgIJAwIBAgEjBQsSBgEMBgIBAQ4Qh3cDCggNonyBMT4xildxhGMBBYcZA4RRAQEBAQEBAQEBAQEBAQEBARcGgQGKUYd1gUSGEAyQMYUeiWRJg3eCfgSPNoNyOIIvI4FecYVmAQEB X-IronPort-AV: E=Sophos;i="5.20,266,1444687200"; d="scan'208";a="153259975" Received: from infao0809.mpi-klsb.mpg.de (HELO hera.mpi-klsb.mpg.de) ([139.19.1.49]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 09 Nov 2015 19:16:20 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mpi-sws.org; s=mail200803; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject; bh=DgXTiR6U8qJdPdN73x5t5oXwTB7vTWTvNuR4ywlvGKk=; b=HDqnSqhfd2ZfMd1rQ63AjdtckXKqOK8QM3JdxUMjdP8YmCczDIya5tHqgs3jDHNHEKHACcOFrc8SeHu7gpoJhZIYND4A29Hui03gZ3RX25C2Ha72DE6rcCropOZMm5dPgc+rDpIXvYWyHhtmgeRmJsh9E1afZs0n4v3Cs5yAXTI=; Received: from maniac.mpi-klsb.mpg.de ([139.19.1.28]:58334) by hera.mpi-klsb.mpg.de (envelope-from ) with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) id 1ZvqzI-0001LU-OG; Mon, 09 Nov 2015 19:16:19 +0100 Received: from [74.125.57.238] (port=59730 helo=bozo.muc.corp.google.com) by maniac.mpi-klsb.mpg.de (envelope-from ) with esmtpsa (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) id 1ZvqzI-0007jQ-2j; Mon, 09 Nov 2015 19:16:16 +0100 To: Gabriel Scherer , Alain Frisch 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> Cc: caml users From: Andreas Rossberg Message-ID: <5640E2EF.7070400@mpi-sws.org> Date: Mon, 9 Nov 2015 19:16:15 +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; format=flowed Content-Transfer-Encoding: 7bit X-MPI-Local-Sender: true Subject: Re: [Caml-list] Newbie comment on constructor syntax On 11/09/2015 07:08 PM, Gabriel Scherer wrote: > If we gave a functional semantic to the unapplied constructor, then I > think that good taste would mandate for the application of this > function and the application of the constructor to be equivalent. This > means that by choosing a tuple-taking function, we commit to the > tuple-application syntax (that nobody likes), and that choosing a > currified function creates an unpleasant inconsistency in the > language. > > I don't know whether we could ever manage to transition to a currified > syntax for constructors, but right now it is at least conceivable > because the application syntax is just a concrete syntax choice, it > does not affect typing. Turning unapplied constructor into a function > (tuplified or currified) makes it a typing property, observable at > specification boundaries: we cannot change it. Hm, I see your point, but don't you already introduce that problem (i.e., commit to tuples) by allowing the `C x` sugar for n-ary constructors? Because in a world of curried constructors, `x` would not be typed as the tuple of arguments, but only as the first argument of the constructor. /Andreas > On Mon, Nov 9, 2015 at 6:33 PM, Alain Frisch wrote: >> On 09/11/2015 11:35, Andreas Rossberg wrote: >>> >>> Yes please, I would appreciate such sugar. >> >> >> I've now submitted a cleaner implementation, working on both expressions and >> patterns: >> >> https://github.com/ocaml/ocaml/pull/284 >> >>> Even more I would appreciate >>> generalising that to allowing constructors to be used as first-class >>> expressions (i.e., unapplied "C" -> "fun (x1,...,xN) -> C (x1,...,xN)" >>> when C is a constructor with arity > 0). I had to write some AST mapping >>> code recently that would have vastly benefited from that. >> >> >> This is not covered (and now, it could simply be "fun x -> C x" :-)). I >> don't see anything clever to be done on patterns for "unapplied >> constructors", though. >> >> >> Alain >> >> >> -- >> 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