Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125462 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 579331A00BD for ; Fri, 6 Sep 2024 23:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1725666162; bh=ZY+F8GkTUVx4SUcJf89pEP2FUwTNCIOjHbtu7d3X7dM=; h=Date:From:To:In-Reply-To:References:Subject:From; b=UjQhy+kcQut3Ld3fYb/JXtjE7WKAuBs6emIDXqO6+fqouFQngb29FDECKQMD8fHEG dY8aLN34UyizwG1LrRJBtyiP85aUJDdJOM6AHnN5FdfQSb04nmGFNTKm07jFsdHudq G0Jgl9WFiWZEPyeo8XXQE644Hi1Psg/s6wJBkyqJVjQGoK4XQLziSbb/UXHZlw4RAQ i7dq8u/i7IWTJpRSmlNIgkSXAyU6MZGvK9tla334UUm9Vb/LNfjCjFOWoLlX+eLMEA ++CqJm3gH71SpoVaJ7/94WS5po6cqB+hb3jTYGjnQKbW6F9YfOjSNoUtGTXdY+1Pj2 GFRzMyo+oCDMA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9E4C2180068 for ; Fri, 6 Sep 2024 23:42:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 6 Sep 2024 23:42:41 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id 172B011401B7 for ; Fri, 6 Sep 2024 19:40:42 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-01.internal (MEProxy); Fri, 06 Sep 2024 19:40:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1725666042; x=1725752442; bh=vSWvsy04c1 TZZvo4NqxGG3r40tUpap8k3hTCurlMF8U=; b=Z892Xv5UbVg1BsBy22rwl5TE76 qnqJDxfu/DRz9O1a06n0IWs2Qwun3WzHeTk25aRB2cS/pzJE/G57Fli9Uj4LXzWx a5p3sXi7W9A0KweMXgs4ANT0B78LSYhjd1pTNiPkbmsmaBpj3kqlmWD3IGiYETKZ aaO0diF0GI30AjCx/r5HYfO2hyx+by10PBjiQDq54mYmXrPwmoS0GmZqnOdBJ2cG vKXAlc24Ez5gU5UUWa29MctvdYep0pdFhnekyqc0xF7WmENcuuN8bFn8P+PocPeV F/Wbjt8U/YnXHpRT6+4QfVTFA/KHPJ2M+kGwMzG9ULbWBgErh/psUnqTx3tA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1725666042; x=1725752442; bh=vSWvsy04c1TZZvo4NqxGG3r40tUp ap8k3hTCurlMF8U=; b=A+EoJO/MkVYNotLXdHxFtqQWsyyxWE/juCqt4BNXzNo1 5BSzls0a+Auu1e9RGO8Hegp/PxCtpSbMDHrzIu8HHYwMTAhh6kLPahgGe2tcoclv N45sg5B0jgfaPfVzAwKahyKhfGqgyi5LMo+hFdKCrE6Oyvt0iI6Lme9z01ESJueh dF13fJF8AG1JVYNcP98AxNnDgazZ/y1dZ17fAIJqNeDaFF0zciR6CjAwoD7/w+bf gFZOWuh2D4umRzxiuFny8MyFmGjflJcBmHhO5AZ7+PJRv4724VrgR1qLk7FYYCX0 ygsEjDVe6LvjhZWoKH4SZR1pjQanQC4LNrFBL0RdMg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeivddgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucgoufhushhpvggtthffoh hmrghinhculdegledmnecujfgurhepofggfffhvffkjghfufgtsegrtderreertdejnecu hfhrohhmpedftfhosgcunfgrnhguvghrshdfuceorhhosgessghothhtlhgvugdrtghoug gvsheqnecuggftrfgrthhtvghrnheptdeitddvvdevhfdufffhgeelffetgeffveekheek feeluedutdeiveekvdetjedvnecuffhomhgrihhnpeefvheglhdrohhrghenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrohgssegsohhtthhl vggurdgtohguvghspdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id DF79B780067; Fri, 6 Sep 2024 19:40:41 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Sat, 07 Sep 2024 01:40:21 +0200 To: internals@lists.php.net Message-ID: In-Reply-To: <79e58673-50ec-461e-a998-736b020e4287@app.fastmail.com> References: <0fa39535-f22d-4eba-b4df-90abe39e683a@app.fastmail.com> <79e58673-50ec-461e-a998-736b020e4287@app.fastmail.com> Subject: Re: [PHP-DEV] bikeshed: Typed Aliases Content-Type: multipart/alternative; boundary=d3d3816f44b545f3b0a044d32ad3eee5 From: rob@bottled.codes ("Rob Landers") --d3d3816f44b545f3b0a044d32ad3eee5 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sat, Sep 7, 2024, at 01:34, Larry Garfield wrote: > On Fri, Sep 6, 2024, at 6:27 PM, Rob Landers wrote: >=20 > >> I suspect there's also other edge case bits to worry about, particu= larly if trying to combine a complex alias with a complex type, which co= uld lead to violating the DNF rule. For example: > > > > Oh, DNF is the bane of my existence with this RFC=E2=80=94I don't wa= nt to mess=20 > > this up. I'll see you at the end of the example, though. > > > >>=20 > >> typealias Foo: (Bar&Baz)|Beep; > >>=20 > >> use (Bar&Baz)|Beep as Foo; > >>=20 > >> function narf(Foo&Stringable $s) {} > >>=20 > >> With the compile time approach, that would expand to `(Bar&Baz)|Bee= p&Stringable`, which is not a valid type def. > > > > I can see how you arrived at this, but I think you may have missed a=20 > > step, since the entirety of Foo will be &'d with Stringable. > > > > Foo =3D (Bar & Baz) | Beep > > > > want: (Foo) & Stringable > > > > expand Foo: ((Bar & Baz) | Beep) & Stringable > > > > Which can be reduced to the following in proper DNF (at least, it=20 > > compiles=E2=80=94https://3v4l.org/0bMlP): > > > > (Beep & Stringable) | (Bar & Baz & Stringable) > > > > It's probably a good idea to update the RFC explaining how expansion= works. >=20 > Woof. We're not "fixingup" anyone's DNF elsewhere. I cannot speak fo= r everyone, but I'd be perfectly fine not doing any magic fixing for now= , and then debating separately if we should do it more generally. Just = doing it for aliases doesn't seem like the best plan. >=20 > --Larry Garfield >=20 Oh, we're definitely not "fixingup" the expression to DNF... more like s= pending some time in the RFC showing how the expansion is the same execu= tion as with a DNF expression to prove that it is a valid type expressio= n. =E2=80=94 Rob --d3d3816f44b545f3b0a044d32ad3eee5 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

=
On Sat, Sep 7, 2024, at 01:34, Larry Garfield wrote:
<= /div>
On Fri, Sep 6, = 2024, at 6:27 PM, Rob Landers wrote:

>&g= t; I suspect there's also other edge case bits to worry about, particula= rly if trying to combine a complex alias with a complex type, which coul= d lead to violating the DNF rule.  For example:
><= br>
> Oh, DNF is the bane of my existence with this RFC=E2=80= =94I don't want to mess 
> this up. I'll see you a= t the end of the example, though.
>
>&= gt; 
>> typealias Foo: (Bar&Baz)|Beep;
<= /div>
>> 
>> use (Bar&Baz)|Beep a= s Foo;
>> 
>> function narf= (Foo&Stringable $s) {}
>> 
&g= t;> With the compile time approach, that would expand to `(Bar&Ba= z)|Beep&Stringable`, which is not a valid type def.
&g= t;
> I can see how you arrived at this, but I think you= may have missed a 
> step, since the entirety of = Foo will be &'d with Stringable.
>
&g= t; Foo =3D (Bar & Baz) | Beep
>
> = want: (Foo) & Stringable
>
> expan= d Foo: ((Bar & Baz) | Beep) & Stringable
>
<= /div>
> Which can be reduced to the following in proper DNF (at l= east, it 
> compiles=E2=80=94https://3v4l.org/0bMlP):
>
<= div>> (Beep & Stringable) | (Bar & Baz & Stringable)
<= /div>
>
> It's probably a good idea to update th= e RFC explaining how expansion works.

Woof.=   We're not "fixingup" anyone's DNF elsewhere.  I cannot speak= for everyone, but I'd be perfectly fine not doing any magic fixing for = now, and then debating separately if we should do it more generally.&nbs= p; Just doing it for aliases doesn't seem like the best plan.
<= div>
--Larry Garfield


Oh, we're definitely not "fixingup" the expression = to DNF... more like spending some time in the RFC showing how the expans= ion is the same execution as with a DNF expression to prove that it is a= valid type expression.

=E2= =80=94 Rob
--d3d3816f44b545f3b0a044d32ad3eee5--