Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92501 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 47526 invoked from network); 19 Apr 2016 22:22:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Apr 2016 22:22:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.215.66 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.215.66 mail-lf0-f66.google.com Received: from [209.85.215.66] ([209.85.215.66:35517] helo=mail-lf0-f66.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C8/1B-22821-DAFA6175 for ; Tue, 19 Apr 2016 18:22:37 -0400 Received: by mail-lf0-f66.google.com with SMTP id o124so4085596lfb.2 for ; Tue, 19 Apr 2016 15:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=golemon-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=o4JwSVCmrEqswF2ogrQjmExhGQDJkqZwi3EQm4rkc54=; b=nGDOZN+Me0EcPkOPR1LSP+g879eYr9aTWgegayEfE5HDNWAtdybSgSrNukMRDqBoNc /L1vT2BbaQ7X+gntXNKslTtf0qNQp6Z+cOpzfkB9DfhteC98U48ibDlgR5lrNTwCD2lG qL4umff3G/s9rmXJpvU1jzAkSpwPJ4Hs3TEOu0Z8m7UYuz+63gEk4dWzkXTfYRXQY7vM ATSiYZXGqWf58aeagKNPqvvujgs/Ke9F45zY9UNJFZV1i4FKisKS0bzgNS/KbRD28q4V LiI6RLQ9FkLVmeGOGQXolA8zrK/mORlm/nCyU72Dl1kzZ9FRx8YjNLUHVY/MBpMpXxmZ 2DQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=o4JwSVCmrEqswF2ogrQjmExhGQDJkqZwi3EQm4rkc54=; b=hp01xbmUKM9RrpXJfst+wR+yIErapppmrtzssBYKQFfR4dGRqpBiBt2vtpMmUH22jp x2uA2+wPKmhizDlyIV5hPinUjt3KsCJjyY73V5wyHf7Q4YCA/usaJLl3I7fF4vVKA99F j/7cEu9bgmDyR417/ZLS/rCUnJzfDbHwk3Vy/ppfd0xrCf57/2BbMEExOvVNy6g+T5eM LF6OJXdGRLydPIemNRieODnNuaOGcYB5GzBfTiWUPuFyT3ZZTZ5AywQGqwpzL6WgpIAS mdYetRzs1TwiH/G9NAp37JxkcDslSbpdDOOV4MowHFPHWlygC1cD4rxrOa36+ZhJzU1o t26g== X-Gm-Message-State: AOPr4FW4sC2OrM5jBctf48s2dCOYLGsPaTZaJXcAeSjsk4DtGm6lN/uxq+aal/8Bpat7VIa5FKBvE8Ao0HgbLA== MIME-Version: 1.0 X-Received: by 10.25.136.67 with SMTP id k64mr1890919lfd.60.1461104553996; Tue, 19 Apr 2016 15:22:33 -0700 (PDT) Sender: php@golemon.com Received: by 10.112.19.74 with HTTP; Tue, 19 Apr 2016 15:22:33 -0700 (PDT) X-Originating-IP: [107.198.91.68] In-Reply-To: <3cc8a4c7-2640-11ae-a67b-06f909ac1e27@texthtml.net> References: <3cc8a4c7-2640-11ae-a67b-06f909ac1e27@texthtml.net> Date: Tue, 19 Apr 2016 15:22:33 -0700 X-Google-Sender-Auth: D4-6SiInDP9_PfjtqlKEWNBDAkU Message-ID: To: Mathieu Rochette Cc: Dominic Grostate , Josh Di Fabio , PHP internals , "Ben Scholzen 'DASPRiD'" , Rasmus Schultz Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC:generics] From: pollita@php.net (Sara Golemon) 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. > can generic types be nested ? > > class Stuff> > I can't imagine why not... 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