Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114459 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 32079 invoked from network); 13 May 2021 08:37:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 13 May 2021 08:37:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CF3AC180211 for ; Thu, 13 May 2021 01:45:16 -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 autolearn=no autolearn_force=no version=3.4.2 X-Spam-Virus: No X-Envelope-From: Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 13 May 2021 01:45:13 -0700 (PDT) Received: by mail-wm1-f51.google.com with SMTP id s82so14202253wmf.3 for ; Thu, 13 May 2021 01:45:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RXbp8ZJ3VcxwOmdLuD3hmXNpfSfe9l87G80jdUHxaNQ=; b=SEFic5QTSsfDQKKFaf4Sv6fyhaWmQb0unUlJJn7eWpjkWA694jYpkdTUDwsxrb222N waNTRcvHv0l8IaF1JU5OjNZkYttqSuBQsd+ttaK6STZeqH3U0wXrnEd7NSeiBrMNQ6Oh jfcNDEUUpYZafBd1KCbnfCMyAu+SOb3FI7kWEPlMoGB7sR6qIEf8smRmD+C0ewY4Duom GmsRmutJBSgg73hCMMyAOVNNrPX2S+lbfGTy5DXc6ved+Zukz9lC3F5rj4/hV0XXGVvs rbWv9eC9EJulWYTAxRj6zzHkXSo1P+ASro/hg5+cUE18DuZcZGJmdHVLwIr/krvlTPeo gsgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RXbp8ZJ3VcxwOmdLuD3hmXNpfSfe9l87G80jdUHxaNQ=; b=rAE7oz8IaDYvgOrye7PFcR+OGctogblef8UrPnhvcz9XXWdOlQugqfvXXh74AQ2qO/ bmeAQXOH9vqAHKP7X1ruQP+VW5fByJqkJmlj/YxB9ytc1ays25akmhe21hd1fpMF1C9V HZ7D+eKqPcFrk+gY+gRnGU1/6kjeogFSstbFi/9RJJ1OVRlgxt3Y7PYOs/g9QwtuaSh/ C3cWeYfiXSFe1DNxdn6kdmP5qm1oZVJC2wbFrozYBkgthrWwOzuS/FpPSWWfFT6aaPbV tP6VjoZJsirxHgEFXtqcu9MHKXktE0UZEdTRYUMTF1Ojsp6XZXsM5r59mm5HNFIcZq24 U0kw== X-Gm-Message-State: AOAM531eGQ1JJVG+V7GJexFg3gDtOTJH5irWqvC6VAJTY0fRbM2zRXxy fGucV2jEqxJVyieWcGQU1KZVVsGjddFnfay88WHQ3HrmA3U= X-Google-Smtp-Source: ABdhPJwYhNY4/ulIk6B51KEYJNSOPhq5Ea67MBCWd3ctu0l0DAkXB+O6WjHs5OLyDfn7ZzjYuo9yY5QL4u60b6WOPxg= X-Received: by 2002:a7b:c206:: with SMTP id x6mr2664189wmi.72.1620895507497; Thu, 13 May 2021 01:45:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 13 May 2021 11:44:54 +0300 Message-ID: To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Subject: Re: [PHP-DEV] [RFC] Partial function application From: someniatko@gmail.com (someniatko) > Greetings, Internalians! > > I would like to offer for your consideration another RFC, specifically syntax for partial function application. > > https://wiki.php.net/rfc/partial_function_application Thank you again for one more wonderful language change! I am sure this is a huge step into the correct direction for the language. One of the nice side effects of this proposal is that it is great for reducing visual clutter when being used in functions like `array_map()`, `array_filter()` etc. However, I have a small nitpick, which may probably be a bit hard to implement: what about partially applied constructors? They are sort of functions as well. For instance: ```php $strings = [ 'value-1', 'value-2' ]; $objects = array_map( fn (string $s) => new ValueObject($s), $strings ``` to be turned into ```php $strings = [ 'value-1', 'value-2' ]; $objects = array_map(new ValueObject(?), $strings); ``` There is unfortunately no mention of partially applied constructors in the RFC. If it is not implemented as above, could you please consider adding it to the Future Scope probably?