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 578FF7ED1D for ; Sun, 11 Oct 2015 10:36:53 +0200 (CEST) IronPort-PHdr: 9a23:pkYH/BOp4R4gCOBkjB0l6mtUPXoX/o7sNwtQ0KIMzox0KPT4rarrMEGX3/hxlliBBdydsKIYzbqO+Pi9EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35jxh7j5o8CbSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6LoJvvRNWqTifqk+UacQTHF/azh0t4XXskzySheG4zM2W38QlQsAVxnC8Bj/VJ7rtCzrnuV40Siee8bxSOZndy6l6vIhcBL0lCodfxd/uFzNicF8haYR6Ea5rgFlwIPYaYW9O/93f6ebdtQfEzkSFv1NXjBMV9vvJ7AECPAMaKMB99Hw Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=paurkedal@gmail.com; spf=Pass smtp.mailfrom=paurkedal@gmail.com; spf=None smtp.helo=postmaster@mail-oi0-f41.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of paurkedal@gmail.com) identity=pra; client-ip=209.85.218.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="paurkedal@gmail.com"; x-sender="paurkedal@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of paurkedal@gmail.com designates 209.85.218.41 as permitted sender) identity=mailfrom; client-ip=209.85.218.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="paurkedal@gmail.com"; x-sender="paurkedal@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-oi0-f41.google.com) identity=helo; client-ip=209.85.218.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="paurkedal@gmail.com"; x-sender="postmaster@mail-oi0-f41.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DEAQBMHxpWlCnaVdFeg3pfDwa/VSOCcIIKfwKBDwc8EAEBAQEBAQEBEAEBAQEHCwsJHzCCH4IIAQEDARIRHQEbHQEDAQsGBQs3AgICHwEBEQEFARwGEyKHdgEDCggNoUKBMT4xi0mBbIJ5iGwKGScNVoRLAQEBAQEBAQEBAQEBAQEBAQEBFAEBBA6GZoR9glCBawEBNRsHgmmBRQWVZgUoAYJNgWFqhg2BdJQ6hX0SI4EXOIIvI4FdPDMBhimBQAEBAQ X-IPAS-Result: A0DEAQBMHxpWlCnaVdFeg3pfDwa/VSOCcIIKfwKBDwc8EAEBAQEBAQEBEAEBAQEHCwsJHzCCH4IIAQEDARIRHQEbHQEDAQsGBQs3AgICHwEBEQEFARwGEyKHdgEDCggNoUKBMT4xi0mBbIJ5iGwKGScNVoRLAQEBAQEBAQEBAQEBAQEBAQEBFAEBBA6GZoR9glCBawEBNRsHgmmBRQWVZgUoAYJNgWFqhg2BdJQ6hX0SI4EXOIIvI4FdPDMBhimBQAEBAQ X-IronPort-AV: E=Sophos;i="5.17,666,1437429600"; d="ml'?scan'208";a="150189415" Received: from mail-oi0-f41.google.com ([209.85.218.41]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 11 Oct 2015 10:36:40 +0200 Received: by oiak8 with SMTP id k8so49071357oia.1 for ; Sun, 11 Oct 2015 01:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=36iT44pPCYl3jmvmR22DT/Ex8a3F+fSicIMZrSl+LYo=; b=xxaW6WvLc02NQnbT16YWlQAwgaXJFVhw1bWNxVjtcIdOIw36z/CJz90iVqhT7Ldqs2 TkpyYa6QFAkehs5N1s0GV7r586OKA+uNdXoA19if2/MjNER4KHYhWkdhCSdy6qwZcFTL yfWQy3wmP/uHahcXX0YPDRTcB/ZUnk2hikhR1+ITZz8CHpX1IRCZmHmHfSeN4MEOAS18 Y8RSr/IMNXkqKkSgzyj58D+JepT+KUKk/uh7Ljdv2ilHU3099t8yrzjjdHTb/P5R6cho 42iHZZ0LZdENAI6IPo2xUhyjEPPxbw3nhYwMBss/crGViLn6wZvNoLpJaaMpcMWWq+Xe 001Q== MIME-Version: 1.0 X-Received: by 10.202.176.9 with SMTP id z9mr12210402oie.105.1444552598654; Sun, 11 Oct 2015 01:36:38 -0700 (PDT) Received: by 10.202.92.136 with HTTP; Sun, 11 Oct 2015 01:36:38 -0700 (PDT) In-Reply-To: References: Date: Sun, 11 Oct 2015 10:36:38 +0200 Message-ID: From: "Petter A. Urkedal" To: Yotam Barnoy Cc: Martin DeMello , Nils Becker , "caml-list@inria.fr" Content-Type: multipart/mixed; boundary=001a113d5b8e80e34a0521d01c88 Subject: Re: [Caml-list] pipe input short syntax idea --001a113d5b8e80e34a0521d01c88 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2015-10-11 3:31 GMT+02:00 Yotam Barnoy : > Interesting, but seems like overkill to me personally. I'm ok with @@ and= |> > (which already breaks F#'s convention, since @@ would be <| in F#. What's > the reason we went with @@ instead again?). I think it's really useful that @@ is right associative. There was a post [1] arguing the opposite for Haskell's $, but that presumes we have a composition operator at a higher precedence level, and that OCaml transforms it into a plain application, for efficiency. > Function composition is > potentially more confusing, and I think keeping it with a consistent > associativity direction (that being the direction of normal function > application from right to left) has value. So I'm personally sort-of ok w= ith > <<, but once you suggest something as beautifully concise as o, I'm > overwhelmed by the convenience factor. For composition, associativity wouldn't matter as the operation itself is associative. Except from performance. According to the attached benchmark, the normal composition operator should be right associative, at least on my computer. Then reversed composition should be left associative. But it's not a big difference (esp. considering that most uses are binary or ternary) and I'm not sure whether it applies across compiler versions. I expected the opposite result. I'm not thrilled about using a single letter o as an operator. If we want =E2=88=98, we should use that, though some might not like to deal with input methods. I've use *< and *> for some time, thinking of * as the closest cousin of =E2=88=98. [1] https://mail.haskell.org/pipermail/haskell-cafe/2006-February/014237.ht= ml --001a113d5b8e80e34a0521d01c88 Content-Type: text/x-ocaml; charset=US-ASCII; name="composition_associativity.ml" Content-Disposition: attachment; filename="composition_associativity.ml" Content-Transfer-Encoding: base64 X-Attachment-Id: f_ifm80gtf0 b3BlbiBQcmludGYKKCogb3BlbiBJbmZpeCAqKQoKbGV0ICggKjwgKSBmIGcg eCA9IGYgKGcgeCkKbGV0ICggKio8ICkgZiBnIHggPSBmIChnIHgpCgpsZXQg dGVzdDEgZiBnID0KICBmICo8IGcgKjwgZiAqPCBnICo8IGYgKjwgZyAqPCBm ICo8IGcgKjwgZiAqPCBnCgpsZXQgdGVzdDIgZiBnID0KICBmICoqPCBnICoq PCBmICoqPCBnICoqPCBmICoqPCBnICoqPCBmICoqPCBnICoqPCBmICoqPCBn CgpsZXQgY2xvY2sgKCkgPSBVbml4LigodGltZXMgKCkpLnRtc191dGltZSkK CmxldCAoKSA9CiAgbGV0IHQwID0gY2xvY2sgKCkgaW4KICBsZXQgeCA9IHJl ZiAwIGluCiAgZm9yIGkgPSAwIHRvIDEwMDAwMDAgZG8KICAgIHggOj0gdGVz dDEgc3VjYyBwcmVkICF4CiAgZG9uZTsKICBsZXQgdDEgPSBjbG9jayAoKSBp bgogIGZvciBpID0gMCB0byAxMDAwMDAwIGRvCiAgICB4IDo9IHRlc3QyIHN1 Y2MgcHJlZCAheAogIGRvbmU7CiAgbGV0IHQyID0gY2xvY2sgKCkgaW4KICBw cmludGYgIkxlZnQgYXNzb2NpYXRpdmU6ICAlZ1xuUmlnaHQgYXNzb2NpYXRp dmU6ICVnXG4iICh0MSAtLiB0MCkgKHQyIC0uIHQxKQo= --001a113d5b8e80e34a0521d01c88--