Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:113934 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 60095 invoked from network); 3 Apr 2021 12:24:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Apr 2021 12:24:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AE128180003 for ; Sat, 3 Apr 2021 05:22:18 -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=-0.7 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, 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-ed1-f46.google.com (mail-ed1-f46.google.com [209.85.208.46]) (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 ; Sat, 3 Apr 2021 05:22:18 -0700 (PDT) Received: by mail-ed1-f46.google.com with SMTP id o19so7895356edc.3 for ; Sat, 03 Apr 2021 05:22:18 -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=Epoplds5RPmathta3H48IOER8zXWyg/Zow4E2q9ybqk=; b=Pv9l+jvrxwfSLLhBbgxDWPDOeI70h4uQ5hBaE7O7iEzn4g1Z1gkM7PnxZfhUjaBa1r LnL3RpSrUHqqTIW3qtsV7FocJZ9T/Pg+RbI/4ivR/r3Tx428W48R1UFFdE/7ud/JU/z/ K4EnD76OC7syn/XayD1PwigC0XPA7c5PKKRl9ZRkOPwj64l7M0rG7l74xU8a2mXQ2Sf3 NCnpVaaeiRgOVlTAxnz4kVLyOq5gdukLlReXpkIp2GRByZnKhF5ljc9Jmwqof4sp/fFJ QRnsuoDqrGdZAqJ74Mr2Eesbfa24bab3UfaNwghcJw8c5W7kf3bNCRv+aHJMcveJzWGU nXUw== 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=Epoplds5RPmathta3H48IOER8zXWyg/Zow4E2q9ybqk=; b=RtZ8uQhRXAvYdGqcjGAMTPeEmdGn4HNX33Z02e4X1WmbXOEAoFIYjIvcW9SyUghnbN WJbb6mfq3jQxJ4AetYKmLswDD4eK1efsbg+JOaTCTap7Hu83LTa6ZDRgnBYpta76iObu G/DnUT2z5v4Gg0zlS/xSKL0WK2yqxp4/KU0B93VFd8JyXBLBgMCOuL253oUXHvzGp/oN 48IUutleQsD/YjR0520DZ+a9xqKZvNleiOU2ZaRP1d4r2eJ77lER4b9Jj3j0lzokFEjl A+yCpTSZIQtqmq9Zr8gA24GrrhOuq6qIvk5kijpOAf6D/Ii5EieC/FZIH3yaYYALkVaE qKUQ== X-Gm-Message-State: AOAM533BDmXv5xwmzuBVRMJynuVA7OpFaN7kJy5IEHQ5qPncWoLoLkUf mqecCAi+S+wQTMpEXKkzidq+2IQOntDoWob7hHI= X-Google-Smtp-Source: ABdhPJwzFVf4vyqZyXIAwXB2JQyEHIXfP8Dl8oeVYSkZBkzhEiohnCPt1F9PuYEdrzC9YjQEuYatOpQgiG6bsqgL/x0= X-Received: by 2002:a50:eb8f:: with SMTP id y15mr20901284edr.115.1617452536051; Sat, 03 Apr 2021 05:22:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 3 Apr 2021 13:22:05 +0100 Message-ID: To: Matthew Brown Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000da3be105bf108342" Subject: Re: [PHP-DEV] [RFC] Pure intersection types From: george.banyard@gmail.com ("G. P. B.") --000000000000da3be105bf108342 Content-Type: text/plain; charset="UTF-8" On Tue, 23 Mar 2021 at 19:45, Matthew Brown wrote: > On Tue, 23 Mar 2021 at 05:32, G. P. B. wrote: > >> I'm calling this proposal pure intersection types as there would be no >> possibility of mixing intersection and union types, I'm leaving this as a >> future scope. >> > > Does this miss an opportunity, though? It's useful to be able to write > A&B|null. > Obviously this is less powerful than support for composite types where one can use both intersections and unions. I've tried implementing composite types without grouping here: https://github.com/Girgias/php-src/pull/8 But I'm hitting various issues and I'm far from confident that I'll be able to resolve them and add the variance check code before June so that this can reasonably get voted in for PHP 8.1. The end goal is support for composite types but I prefer to land a reasonably self contained feature in 8.1 then nothing at all. Internals might disagree with this and refuse the feature unless "complete" but if that's the case there is still time to "finish" it for another RFC. If someone else wants to work on adding support for composite types they are free to work based on my PR, or collaborate with me. I've also tidied up the RFC: https://github.com/Girgias/intersection-types Unless someone shows up to work on composite types, I'll probably bring this to a vote next week (if I don't forget about it). Best regards, George P. Banyard --000000000000da3be105bf108342--