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 79D7C7EEFA for ; Mon, 9 Nov 2015 19:09:01 +0100 (CET) IronPort-PHdr: 9a23:VLMA2BVjpZf21lfc8hEOOzbsfjHV8LGtZVwlr6E/grcLSJyIuqrYZxSPt8tkgFKBZ4jH8fUM07OQ6PC9HzBbqs/Z7zgrS99laVwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfTR8Kum9IIPOlcP/j7n0oM2OJVkTz2PlPvtbF1afk0b4joEum4xsK6I8mFPig0BjXKBo/15uPk+ZhB3m5829r9ZJ+iVUvO89pYYbCf2pN4xxd7FTDSwnPmYp/4Wr8ECbFUrc0EABSX0bmQZkBA3M7ReyHsug83iyiu0o8S2TPMu+Y6o1Qj+ip/NiTBbpjmEJLT8i+2H/jsFgjaxa5hmmokos7ZTTZdS6PfBkf67ZNegRRWdbU9wZAyNICJm9Yo9JFOEBMPxVtaHyolIPqV21Agz6V7Cn8SNBmnKjhf5y6O8mCwyTmVF5Eg== 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-ig0-f178.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.213.178; 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.213.178 as permitted sender) identity=mailfrom; client-ip=209.85.213.178; 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-ig0-f178.google.com) identity=helo; client-ip=209.85.213.178; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-ig0-f178.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D0AQDQ4EBWlLLVVdFeg1o0bwatGoFPhTGMDyGFbwKBPAc8EAEBAQEBAQEBEAEBAQEHCwsJHzCCLoIIAQEEEhEEGQEbEgsBAwwGBQsNAgIJHQICIgERAQUBChIGExIQh3YBAxINoniBMT4xi0iBaoJ5hlMKGScDClaDcQEBAQEBAQEDAQEBAQEYAQUOc4VThH6HdYFEBYYLDJAxhR6ICYFbSYN3lF0SJIEXOIIvI4FePTSFZgEBAQ X-IPAS-Result: A0D0AQDQ4EBWlLLVVdFeg1o0bwatGoFPhTGMDyGFbwKBPAc8EAEBAQEBAQEBEAEBAQEHCwsJHzCCLoIIAQEEEhEEGQEbEgsBAwwGBQsNAgIJHQICIgERAQUBChIGExIQh3YBAxINoniBMT4xi0iBaoJ5hlMKGScDClaDcQEBAQEBAQEDAQEBAQEYAQUOc4VThH6HdYFEBYYLDJAxhR6ICYFbSYN3lF0SJIEXOIIvI4FePTSFZgEBAQ X-IronPort-AV: E=Sophos;i="5.20,266,1444687200"; d="scan'208";a="153259075" Received: from mail-ig0-f178.google.com ([209.85.213.178]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 09 Nov 2015 19:09:00 +0100 Received: by igbxm8 with SMTP id xm8so56748896igb.1 for ; Mon, 09 Nov 2015 10:08:59 -0800 (PST) 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 :cc:content-type; bh=+aFRRQgqfarxwTgDYvMLtJczQEEMiB2ZWBZK0+4JSp8=; b=L8Zeb9h1PGK/4/iHl2mC0oczohxosS01BFzUxsLVylLVbQEyLcaooCJ7+UxMCzCe6I vxVVGxu4Sc1H07F/PWND5Ohbl8Ud7TRzddg41RvwKHU9AOnDSGrcDPk9fChNqARix+HS 60fm4NuIgcLHADQ5kuNqE8bFon1LwT/2GIpdmz9+EiewS/uzu2lYqam2XkgFBYAvopw3 /HnCbA+Fv2TltqUDKqUDaS4lrAPiMznQeC2T6tFWSl5fquzP9d3RhEn57KnTsnV6MsaH vDA3fclSmAoktSsN0FUoW4W4pn6NuEiCgQo7zrb/al0gChAVYIUmabBBvkUQKHTftjW+ Do7A== X-Received: by 10.50.164.196 with SMTP id ys4mr22370854igb.37.1447092539476; Mon, 09 Nov 2015 10:08:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.39.200 with HTTP; Mon, 9 Nov 2015 10:08:19 -0800 (PST) In-Reply-To: <5640D8E0.6060102@lexifi.com> 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> From: Gabriel Scherer Date: Mon, 9 Nov 2015 19:08:19 +0100 Message-ID: To: Alain Frisch Cc: Andreas Rossberg , caml users Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Newbie comment on constructor syntax 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. 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