Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92528 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12528 invoked from network); 20 Apr 2016 09:10:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2016 09:10:50 -0000 Authentication-Results: pb1.pair.com header.from=codekestrel@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=codekestrel@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.47 as permitted sender) X-PHP-List-Original-Sender: codekestrel@googlemail.com X-Host-Fingerprint: 74.125.82.47 mail-wm0-f47.google.com Received: from [74.125.82.47] ([74.125.82.47:35472] helo=mail-wm0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/25-14036-99747175 for ; Wed, 20 Apr 2016 05:10:50 -0400 Received: by mail-wm0-f47.google.com with SMTP id e201so42550351wme.0 for ; Wed, 20 Apr 2016 02:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=b1HXd/ArxT/JfLXFob7Q8kBTcK3CAozcVlCPLcu7Pe0=; b=zpdQz4c0ZYMCQOIH0dXUa+bqir0cog8G53YJdt6dfDPwNPQPep0SXr1sW6GsI7H0oB 5cHHinw9SxaWnSU3EgMmdRIJ0IMo7FF0M7dgcccf05hShABZUA45POC95NSUMUHExfig Do/sW2S7NbcBQCl9nx/9y9Q2Bgd6ELzXSDRqL3M5wV3CGZK8DxhQVgjktR4bMiswaGy9 tOki/K2E2zmgA0VCkVovXiEAA92GMtMJgzTMcvM3yT+fWbxAxOCOyMRsuveHqO6C9s5S Ej1tPErd3Y9qrlXWiavnbsyk/zYiS1Z7rL6aDmyt8sspA3qBW5JSsi/bsa5pG/ijhtvY VyEg== 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:date :message-id:subject:from:to:cc; bh=b1HXd/ArxT/JfLXFob7Q8kBTcK3CAozcVlCPLcu7Pe0=; b=mj/8eJyyhvWzS53UfnSFKk2E6cz13VPoH1gYU4YPFcVUpWYsYKwTGa5foU+Jy8GU1M 4NEAmbjpN8gWbYwSgwHVUo7P+o5yirtO8ZE46K5dNS2II35VYEJZFRyHnI9ZhnVBgmNi S+6I/LjOkr76bTunCo6BMc+LLkjEMs+1WFbAjMHS06rBNBTlsJPV+IdU8cHx54Kl1WMe ZQ7REOTayzvvcR6/7syk0FB633y4rVorbwZSl8NnguPqpUiOonyDzSsPpo0TaHONUi5i iOzdTiIZZH4+EBNU7RUpPvBMyMS435CjU52oOn2ab0iQ9JNYpQePTuI68p/pi8SkytjF TZSQ== X-Gm-Message-State: AOPr4FV8vwyhzigYo9rOW6pI7d3DavOj91i1oLDMnlpvPXCJlOiwdJHEfCdhoRBEtkdLFBDFBOSHAFk+la0H+A== MIME-Version: 1.0 X-Received: by 10.28.220.67 with SMTP id t64mr27686552wmg.57.1461143447167; Wed, 20 Apr 2016 02:10:47 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Wed, 20 Apr 2016 02:10:47 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Wed, 20 Apr 2016 02:10:47 -0700 (PDT) In-Reply-To: <57173859.4080501@rochette.cc> References: <3cc8a4c7-2640-11ae-a67b-06f909ac1e27@texthtml.net> <57173859.4080501@rochette.cc> Date: Wed, 20 Apr 2016 10:10:47 +0100 Message-ID: To: Mathieu Rochette Cc: "Ben Scholzen 'DASPRiD'" , Josh Di Fabio , Mathieu Rochette , Sara Golemon , PHP internals , Rasmus Schultz Content-Type: multipart/alternative; boundary=001a114b2d5a2272a40530e6f8c7 Subject: Re: [PHP-DEV] [RFC:generics] From: codekestrel@googlemail.com (Dominic Grostate) --001a114b2d5a2272a40530e6f8c7 Content-Type: text/plain; charset=UTF-8 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. 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 >> >> > --001a114b2d5a2272a40530e6f8c7--