Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110318 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 70071 invoked from network); 31 May 2020 13:01:39 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 May 2020 13:01:39 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5AD811804C7 for ; Sun, 31 May 2020 04:43:04 -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=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 ; Sun, 31 May 2020 04:43:03 -0700 (PDT) Received: by mail-il1-f176.google.com with SMTP id 9so6690260ilg.12 for ; Sun, 31 May 2020 04:43:03 -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=DGocA5cpegLBtfAr7NnDDQr+ejVC+a+3QrDc32TQsXY=; b=OmOgTyr0jXHkmPcFG3yJUP931RWFY9+NVh6YdRbeH1D9vvB8d7zZV7CBSN42RrC0dW RCPSFjpwAz4fGSKS0O7Dl4vb1LxlXNWwmiK6BwSY+Nint9RjX9fXsSbt9z10D85lu3xQ RMbh84dkumgkDVjhGSdpdPN8NqkhLVWhzz9L6jf969Sc02HzOBpORaljvIdN7O5DuXY6 tHv+yfKmZayHwD+UD0OkYnWlXVon+h9xRbzGRchmPRDlhtuGzba2yDDQHjy6bq3G+kBD Cz8V+z1VC1+9yoVQ+Zrca1TKUVP/CysmoZmtJPPaY7AHIOIt0wjF3wBLvRZsPpyaXomv TLIA== 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=DGocA5cpegLBtfAr7NnDDQr+ejVC+a+3QrDc32TQsXY=; b=FCxwGa+FuMZT5VW+TuklmKWtFCZqUREu9uOIA2Lhq9U9HMPGUb6C1HWEXC5eGmjQv+ Q26lAoczFbRX1RBoK1xj5XDSkRT0FIoWHgWdyyW7qR/HeYJ093tuzJdX8iqgty8UjvaW yju7B4ztDBxrRYRHi4JJbPh7HHX0gojcxcYcEsWhP7vejd8UOE4fw9wXRKB7Xe2DUm4I 6giDbFoz/S2/rgJEGKDvjfhs5+BR1gQs/p5V6cVaqe6jYyFTX69P5RWL6Qb97wstLm7d ygRF7OHiWkP6Y7dqW6G2UFd2JR8Xl4h3pF8yARlgkPRGzGJRdMi+wGpFO+tWq2vihRKE zgVA== X-Gm-Message-State: AOAM531OBrN3dVwGpdI41wo0BkEbjP0iCW02QHAN3Xf7DF84moqB2hGK SqyAWsOSYA2bAngqqQUeSLYWJAyQtIyzHnIZlvIHwbhz X-Google-Smtp-Source: ABdhPJwVqO+saMnFfP2JfChOUEIiC8++SYGFmUJrzQ6XtsyXrVcoL7h3eCLJjKWl3rM759GXkG7UHH66c342aEYhP2c= X-Received: by 2002:a92:778b:: with SMTP id s133mr14328660ilc.99.1590925376698; Sun, 31 May 2020 04:42:56 -0700 (PDT) MIME-Version: 1.0 References: <28fcb122-a8c5-4b2b-9e10-2f5c98e0aa2a@www.fastmail.com> In-Reply-To: <28fcb122-a8c5-4b2b-9e10-2f5c98e0aa2a@www.fastmail.com> Date: Sun, 31 May 2020 13:42:40 +0200 Message-ID: To: Larry Garfield Cc: php internals Content-Type: multipart/alternative; boundary="000000000000f13ca205a6f02db0" Subject: Re: [PHP-DEV] Intersection types From: carusogabriel34@gmail.com (Gabriel Caruso) --000000000000f13ca205a6f02db0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 31 May 2020 at 04:39, Larry Garfield wrote= : > On Sat, May 30, 2020, at 3:02 AM, Gert de Pagter wrote: > > Hi Internals, > > > > With recent additions of the type system like union types [1], id like > > to propose adding intersection types as well. > > > > Looking through past RFCs I found one from 2016 [2] which never left > > the discussion phase and is currently marked as inactive. > > Before continuing with an RFC I'd like to know if there are any > > particular reasons why the original RFC never got into a voting phase, > > so that this one may be more successful. > > > > P.S. I=E2=80=99d also like to get RFC karma so I could create a proposa= l. > > > > Thanks in advance! > > > > > > [1] https://wiki.php.net/rfc/union_types_v2 > > > > [2] https://wiki.php.net/rfc/intersection_types > > > > To my recollection, the original RFC was met with a general "meh, sounds > complicated, and why would you want to do that?" which is why it never we= nt > as far as a vote. I don't know if there was an implementation. Note tha= t > it was proposed seemingly in conjunction with union types v1, and a lot o= f > the discussion really confused the two. > > 4 years later, Nikita tried union types a second time and they sailed > through. I couldn't say why, but I speculate that it was a combination o= f > 4 years of the community maturing, different people being around, and jus= t > union types without intersection types being an easier thing to swallow. > > I'd say go for it. I'd love to see intersection types, as it would be > very helpful to certain use cases with FIG PSRs. (Eg, "I want an object > that is a Response and also has the Link extensions from PSR-13 on it" is > currently impossible to specify. Intersection types would solve that > perfectly.) > > --Larry Garfield > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php I second everything that Larry said. --000000000000f13ca205a6f02db0--