Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120830 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 89842 invoked from network); 17 Jul 2023 19:07:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 17 Jul 2023 19:07:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E203C1804BC for ; Mon, 17 Jul 2023 12:07:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 17 Jul 2023 12:07:43 -0700 (PDT) Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-34884a8f285so9836325ab.0 for ; Mon, 17 Jul 2023 12:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689620863; x=1692212863; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3VrwDAr6Q+TsdPtBn9zpZqBylD7HBaBuxGBQxUdzUEg=; b=fXIq0KHu3+JRnoX9OfQm7KwzxBdZP7Rqm5YW0Mh2ULa6PKB3X2uuess6OmjkqigJRY SIcp6ZyKIoGn6dcoZzusPTR4/ai1nv8NffW+jEsT3QNbOhEqw5AWDUZZxilla7cZEpZa JkH9yz98U7JbSAgilHbJxy7P9BPe85MJXGWrproWc5YeQ3nMR2jvaDfKJ+iiBLvoZFKH j/dJnV7ryNdznfNQrbih3rZ2UAXcYmaTmhZm7NYAu2vB66eo4H+Xc7DgK15H33EVf0mA IlO4XLQchazUIXzY1TpvHJ4dmrISROnediEid727gHcOP7867LODpxCgJDBTdWFP5uIx UejQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689620863; x=1692212863; h=content-transfer-encoding:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3VrwDAr6Q+TsdPtBn9zpZqBylD7HBaBuxGBQxUdzUEg=; b=RcZWt0LZSqoMjMxizBvb2CMmXElFVSE6bBxvu4ectRvslimdiFbnNEgcKOBugQdDdk 4Y0KUHZXR8tiZCzNakkF2N9ocJAp63KQuDXlOC3AT6GoKS4Oz431UZn2pHh44RSEekeG SbejLh/NCDl2boRAawPsIZjJ01Ukxq1w1tGxIx2twz6108+1Ey+z+dmESxVILXYJA/Vh dF87bQjsTsXDD5lfzABodwiyg4GWb4rmkssx+KtnvoKoZPr6FTIUaCs0T7xqiDJAS/0Y kdXD+SwKMQyIleP4YaiGFXBH1R8DZwm8gP2XC6KDicDK/G7yu/u68k5bh+RpBz2Jehm+ fZOw== X-Gm-Message-State: ABy/qLYlZLeL7414Mx+iPS9frc4+9sPlz/tc4MvMuN6p1IoySTE4wzyq DasmiPc9hRc+GfPo7MGri0TH9SDiEBVyYC9FMKocapsP X-Google-Smtp-Source: APBJJlEGE1kshJi+HsyXYBiib3I1B9KxEznUsvSavTA6h3Owmvkm9xnZ09Qs2EEgFkYak+fKebjo2XLQnBB2vnVFdG0= X-Received: by 2002:a92:dd11:0:b0:340:8cb1:aaa8 with SMTP id n17-20020a92dd11000000b003408cb1aaa8mr437411ilm.21.1689620862694; Mon, 17 Jul 2023 12:07:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:b1cd:0:b0:2e2:2af1:79d7 with HTTP; Mon, 17 Jul 2023 12:07:42 -0700 (PDT) In-Reply-To: <8055b366-32f1-4d2c-85d0-0cf665e6c8d3@app.fastmail.com> References: <8055b366-32f1-4d2c-85d0-0cf665e6c8d3@app.fastmail.com> Date: Mon, 17 Jul 2023 21:07:42 +0200 Message-ID: To: Larry Garfield Cc: Karoly Negyesi , php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] pipes, scalar objects and on? From: olleharstedt@gmail.com (=?UTF-8?Q?Olle_H=C3=A4rstedt?=) 2023-07-17 18:58 GMT+02:00, Larry Garfield : > On Mon, Jul 17, 2023, at 2:57 PM, Olle H=C3=A4rstedt wrote: >> 2023-07-17 14:25 GMT+02:00, Karoly Negyesi : >>> Hi, >>> >>> I tried to read on why the pipe RFC failed but by and large I also >>> failed. >>> >>> The discussion on https://github.com/php/php-src/pull/7214 is very >>> short. >>> >>> https://externals.io/message/114770 is not so short but it seems not to >>> cover the latest version which uses first class functions? >>> >>> Could someone please give me a summary why it failed? I really would >>> like >>> to see it succeed :) I am writing code if not daily but certainly weekl= y >>> that certainly looks like a pipeline. >> >> The pipe RFC was kinda forced in before a deadline, no? >> >> My own two cents: >> >> * It's trivial to implement a pipe() function or a Pipe class >> * A Pipe class is better than both a function and built-in operator, >> since it can be configured with custom behaviour, e.g. stop or throw >> on empty payload, or repeat on a collection, or even with parallelism >> or concurrency >> * If I had voting rights, I'd vote in favor in a pipe operator :) > > From my recollection, there were a couple of things involved. > > 1. It was intended to pair with the PFA RFC, which didn't pass, which mad= e > it a bit less compelling. > 2. It was close to the RFC deadline, and it seems people get squeamish > around that. > 3. Some folks wanted Hack-style pipes instead of the pipes used by every > other language with pipes. I've written before on why that's a worse > design. > 4. Arguments that it can be done in user space, which is not true, as I h= ave > a user-space implementation and it's comparatively cumbersome and definit= ely > slower than a native operator would be. > 5. General "meh" attitude on FP features in general from some people. > > Side note to Olle: If you want a customizable pipe, you've just described= a > Monad. :-) It's literally "contextually-sensitive func concatenation." = A > monadic bind operator would be harder to do with PHP's weaker type system= , > but there are ways it could be done. Mm I don't really agree with that, I think monads make sense only in languages which support them syntactically. A Pipe class is a very straight-forward construction, and the blog posts I've read about monads in PHP don't look pretty at all; lots of syntactic noise going on. But that's another discussion... :) Olle