Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92516 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77520 invoked from network); 20 Apr 2016 02:56:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2016 02:56:30 -0000 Authentication-Results: pb1.pair.com smtp.mail=jesseschalken@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jesseschalken@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.196 as permitted sender) X-PHP-List-Original-Sender: jesseschalken@gmail.com X-Host-Fingerprint: 209.85.213.196 mail-ig0-f196.google.com Received: from [209.85.213.196] ([209.85.213.196:36196] helo=mail-ig0-f196.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/80-22821-DDFE6175 for ; Tue, 19 Apr 2016 22:56:30 -0400 Received: by mail-ig0-f196.google.com with SMTP id kb1so4907942igb.3 for ; Tue, 19 Apr 2016 19:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=PwuPznvkRY/pCZ5YDBlSYEyQOoH3ARkFg7TLJOicpWU=; b=exw0nqjWIvTWtxvAhvEpXmH7ecNLGcT3t0gWwQkuCvzDDZnM3hzvnxzUnnCB/NJ6Vy kVv8hgqTkVy2KNB5oqNOpRuBI6PqsCRDQqtmouCcahdCJQND5eb0713H6sN6mEDhA/yy tTKI5nKfK4/Zc7A8BO2oJnv8hV19nNLCvHg6vL0S4uUllMAt7vIWslWKTUqYerzXinuv AaSYGqcSj0EipaTQ2qHQEjhnmCeiJcoyVlmZ6ndb7TAJsBhgRHnqbrwpRtJjpT0zXXLU Z6pPYT3SXYUguhF5vjNarGqmNcQIBkQYCU2fmhyfyeMjIsWYhbxuyINNL+ZRiC2huhaN fHYg== 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=PwuPznvkRY/pCZ5YDBlSYEyQOoH3ARkFg7TLJOicpWU=; b=evpyJHgNsIuL/iks3JD9IjX3XaqlcOjnSHKhhG0cO0vYONi73qjL1vuaEVQzp4ken0 cYKxy8l2mSKX+H2Nxid2Pq2Ab4R/enkEuybhZWGKSIs6jVMQ0PxwhLI2yrvGSW4p8Byy 3isgtMgL+RgLX+21mB8W6CfCABsbvPKFl/UmvIxN3aNNh/ppr0iLcr0W0czxOHU9trOs tz6G7QLYVFlXJsN7hLq2Yf7Fw6Js525xw02QBT3k42y1yCY2N3dLcNepzObZ8vLESUct eOFWqirYo4nQN4whmRPFa5vQA3DJg5GGngoueoyaRiqKHBub5zcXxPo4cjPTOG69Vt8b MOyw== X-Gm-Message-State: AOPr4FUN/3UY3mMNgIsMk4MWipNhSCOv5J+1PCcq3xEhv4jQdB1n3WM9pwRMDmGLXFCudl2vtcP2n0DATahC5w== MIME-Version: 1.0 X-Received: by 10.50.56.114 with SMTP id z18mr820538igp.44.1461120987542; Tue, 19 Apr 2016 19:56:27 -0700 (PDT) Sender: jesseschalken@gmail.com Received: by 10.79.139.133 with HTTP; Tue, 19 Apr 2016 19:56:27 -0700 (PDT) In-Reply-To: References: <3cc8a4c7-2640-11ae-a67b-06f909ac1e27@texthtml.net> Date: Wed, 20 Apr 2016 12:56:27 +1000 X-Google-Sender-Auth: AXGetImlEHM5RsBZtxaIo1ytXGk Message-ID: To: Sara Golemon Cc: Mathieu Rochette , Dominic Grostate , Josh Di Fabio , PHP internals , "Ben Scholzen 'DASPRiD'" , Rasmus Schultz Content-Type: multipart/alternative; boundary=089e0158b3066fbe2e0530e1bd62 Subject: Re: [PHP-DEV] [RFC:generics] From: me@jesseschalken.com (Jesse Schalken) --089e0158b3066fbe2e0530e1bd62 Content-Type: text/plain; charset=UTF-8 On Wed, Apr 20, 2016 at 8:22 AM, 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. > > I think the "where T is Traversable, T is Countable" syntax was intended to represent the intersection (i.e. a "Countable Traversable"), not the union. So you would need an intersection syntax class Collection {... > > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --089e0158b3066fbe2e0530e1bd62--