Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110317 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 21777 invoked from network); 31 May 2020 03:57:32 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 31 May 2020 03:57:32 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8B02D1804D3 for ; Sat, 30 May 2020 19:38:49 -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_20,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 66.111.4.0/24 X-Spam-Virus: No X-Envelope-From: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 30 May 2020 19:38:48 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 31DE25C00A6 for ; Sat, 30 May 2020 22:38:48 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Sat, 30 May 2020 22:38:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=WACxJujXn50c/S73ihpUBk1gzJ1X/Ket7H6PhCxqR 84=; b=NFK2xv98hGhzhfbd4yH7lyNn70IN5HrNmHuVQOTxIxgj9/wg6ijx7lfFi 25PmoCySPMxhRkmjDjaKYwzt6Wh7e7NWG2LWWxzoxplt0+BFZpSQDo/VUakdbVgc D9wtSESdLo/RXUx+0dSO2VKqYiPn2IY+SJLCIlVDpkUOSgDLRIkLRYEWIAPDWSls A4KfUgfuS/FpuTNA5o5oYmNV5gxWhOB62Nu056N0s53dYZjuZfQgW0rnjzWx9JYJ yx7iQxHhA0xt868ZQql6uOQfZjKSD8xGRfq5XJmsbldfdNW1vuEV0RswrjGv0v4L Viev7C5DV4pqy8HyBhDI5MPYhVLVA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudefuddgheejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgfgsehtqhertderreejnecuhfhrohhmpedfnfgr rhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtg homheqnecuggftrfgrthhtvghrnhepgeeghefgteejheeggfeghfelueeggfdtjeeivedv tefhveeguedufeelhedvteeinecuffhomhgrihhnpehphhhprdhnvghtnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhf ihgvlhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id C16EE14200A2; Sat, 30 May 2020 22:38:47 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-504-g204cd6f-fm-20200527.002-g204cd6f2 Mime-Version: 1.0 Message-ID: <28fcb122-a8c5-4b2b-9e10-2f5c98e0aa2a@www.fastmail.com> In-Reply-To: References: Date: Sat, 30 May 2020 21:38:26 -0500 To: "php internals" Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Intersection types From: larry@garfieldtech.com ("Larry Garfield") On Sat, May 30, 2020, at 3:02 AM, Gert de Pagter wrote: > Hi Internals, >=20 > With recent additions of the type system like union types [1], id like= =20 > to propose adding intersection types as well. >=20 > Looking through past RFCs I found one from 2016 [2] which never left=20= > the discussion phase and is currently marked as inactive. > Before continuing with an RFC I'd like to know if there are any=20 > particular reasons why the original RFC never got into a voting phase,= =20 > so that this one may be more successful. >=20 > P.S. I=E2=80=99d also like to get RFC karma so I could create a propos= al. >=20 > Thanks in advance! >=20 >=20 > [1] https://wiki.php.net/rfc/union_types_v2=20 > > [2] https://wiki.php.net/rfc/intersection_types=20 > 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 = went as far as a vote. I don't know if there was an implementation. No= te that it was proposed seemingly in conjunction with union types v1, an= d a lot of the discussion really confused the two. 4 years later, Nikita tried union types a second time and they sailed th= rough. I couldn't say why, but I speculate that it was a combination of= 4 years of the community maturing, different people being around, and j= ust union types without intersection types being an easier thing to swal= low. I'd say go for it. I'd love to see intersection types, as it would be v= ery 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" i= s currently impossible to specify. Intersection types would solve that = perfectly.) --Larry Garfield