Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92529 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15134 invoked from network); 20 Apr 2016 09:43:18 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2016 09:43:18 -0000 Authentication-Results: pb1.pair.com header.from=quim@kalpe.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=quim@kalpe.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kalpe.com from 209.85.213.169 cause and error) X-PHP-List-Original-Sender: quim@kalpe.com X-Host-Fingerprint: 209.85.213.169 mail-ig0-f169.google.com Received: from [209.85.213.169] ([209.85.213.169:37212] helo=mail-ig0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/95-14036-53F47175 for ; Wed, 20 Apr 2016 05:43:17 -0400 Received: by mail-ig0-f169.google.com with SMTP id g8so43341005igr.0 for ; Wed, 20 Apr 2016 02:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalpe-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HVSHYSdk9LkuBexXpU0Zrlov2KUGEFFmAG4bRCSpIZM=; b=b8VEybXb3yQbo8BhpiXdMX3+VuokaLnMt7m9GlkAco8XDRAhNOqN6gQA6+0blt7rGb 4hBUjAJCYPA6Maan6qTuqDaO05qvcvTYq1xQnLS93INUhsUkjXhE95cI2G37gnMeiaTy xx1919OCiwBYUG3z6S8H+cufoPkmEPWsTPvFJeQLZr3vxKKgJENw8fGVaR4XXF7GTPRy lPrFZxqwtJMcM0BOuG4I3Xvfs5tfkqoZ+NkxHnyFmjJEgbFdVTnIm5PJjPVyd24/X5Ef REzyXA1T8rQqWRPL+tX6zhqIDN9dQb1SbBOB9bEiY+W2QZ0XsZHA/s5e/WRPSizEoneX daFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HVSHYSdk9LkuBexXpU0Zrlov2KUGEFFmAG4bRCSpIZM=; b=dJsiiHfwnMN1dzxI1if8MKKovxLM0g/5j+0Gl+m2Wr/N8bwR9kHbXkmlcrzj31+w5e lF2LQ9ijA1550fL6nsWuwWPRDt4QRUbOH106s+mBK4yVN9QDO1grbkA68uVocLavVFmo oth9uMkq6LA11al9L1dQRyqsJxnC0LKD89bY83smZ8nd8+xKedPsrCFHWmKyfWNjz+QV U3R8A9/WiX5rzRB+VXc9kJVYfrT0T9yFoaAbTxUuywC4CQF1EqQZw3MKTtRlmBE6glm4 pQrAUZJx3x9HZ03eoObvckAvFsq60UE1Sq558xLYf7hrib9t3COIdQVHJT/g875xunqx K/VQ== X-Gm-Message-State: AOPr4FVnS/9nM3H3OUfHsFbxnEuW7E0Y9huEks6Txs8sg1Y0TPhkzpMcZ8nMSB807l/rIYGoZV8a7dcv9krwtA== X-Received: by 10.50.96.132 with SMTP id ds4mr2546586igb.31.1461145394253; Wed, 20 Apr 2016 02:43:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.245.197 with HTTP; Wed, 20 Apr 2016 02:42:54 -0700 (PDT) In-Reply-To: References: <3cc8a4c7-2640-11ae-a67b-06f909ac1e27@texthtml.net> <57173859.4080501@rochette.cc> Date: Wed, 20 Apr 2016 11:42:54 +0200 Message-ID: To: Dominic Grostate Cc: Mathieu Rochette , "Ben Scholzen 'DASPRiD'" , Josh Di Fabio , Mathieu Rochette , Sara Golemon , PHP internals , Rasmus Schultz Content-Type: multipart/alternative; boundary=089e0111e15a30d3bb0530e76ce0 Subject: Re: [PHP-DEV] [RFC:generics] From: quim@kalpe.com (Quim Calpe) --089e0111e15a30d3bb0530e76ce0 Content-Type: text/plain; charset=UTF-8 On Wed, Apr 20, 2016 at 11:10 AM, Dominic Grostate < codekestrel@googlemail.com> wrote: > I've made an amendment to the RFC to clarify on the Nested Types, which is > indeed supposed to be part of the feature. Rasmus may want to reword it if > it isn't very clear. > > Regarding union and intersections for upper (and maybe lower) bounds. > Would it be appropriate to exclude these from type parameters until their > respective RFCs are approved? As including them in generics but not in > standard type hints may create an inconsistency. > > In short, perhaps a generics implementation should incorporate unions (and > any future type constraints) as existing features only. This would help > RFC Generics to focus on: Type aliasing, Introspection and Reflection. > That would be a wise move, there are currently some RFCs with similar areas of contention > On 20 Apr 2016 9:05 a.m., "Mathieu Rochette" wrote: > > > > > > > On 20/04/2016 00:22, Sara Golemon wrote: > > > >> On Tue, Apr 19, 2016 at 1:16 PM, Mathieu Rochette > > >> wrote: > >> > >>> about the upper bounds, have you consider another way of describing the > >>> constraints, eg: > >>> > >>> class Box where T is Boxable > >>> > >>> this would allow multiple constraints, eg: > >>> > >>> class Collection where T is Traversable, T is Countable > >>> > >>> IMO, this sort of problem should be solved by combining this feature > >> with union types, so you could have something like: > >> > >> class Collection {... > >> > >> And merely inherit the logic rules from that feature rather than > >> inventing yet another one. > >> > > obviously if the union type rfc passes we don't need another way of > > expressing this. > > that was only in the case it does not, I think having a way to have at > > least types intersection > > is useful here (and I didn't event think about ) > > > >> > >> can generic types be nested ? > >>> > >>> class Stuff> > >>> > >>> I can't imagine why not... > >> > > just to be clear, it's not just nested generic. the A type have to be > same > > in both "subtypes" > > > >> > >> For my part, I love the concept overall. Generics are an important > >> part of moving PHP towards comprehensive type-safety. But then, you > >> know how I feel about Hack. :) > >> > >> -Sara > >> > >> > > > --089e0111e15a30d3bb0530e76ce0--