Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92646 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46405 invoked from network); 22 Apr 2016 15:00:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2016 15:00:20 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.53 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.53 mail-wm0-f53.google.com Received: from [74.125.82.53] ([74.125.82.53:36531] helo=mail-wm0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/08-14036-C7C3A175 for ; Fri, 22 Apr 2016 11:00:13 -0400 Received: by mail-wm0-f53.google.com with SMTP id v188so24373496wme.1 for ; Fri, 22 Apr 2016 08:00:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=GIJtHV724aBjQu44QG6JCnHxzh4A1G/ECPIQoiB0OAk=; b=M7SowdJ4AdUZqA6+Wvn6aV0gqY/CbCT9IlXC6jJ1w3k1TWBmlaWDV/KcV6IpEyoBGf 1bGQnDrcMw4pZ60VrkLtkvbOkhQc5gDZPP+Ck06mcFL3ZdXTJJXhDy0TfVYnnibzOfw3 1aJeyUvCuog7PG92OK04xLTqmOIJ1TnpdGRyWgY0lTauPMULKfwNiPD9xKLJmJMxfqQZ U5zEgbiUI/OE6zDD06L+cPIFVH/NTlUzlm5V3jbiZQdYnChVz9BTtAwLyfBmwFwSmgEe wgLOl+n5p210hQaYz1/a3+RdpIFMtsTzAFolN9XkRGDTrgatQsSd5NEFu0t1MD7Ml46n w3tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=GIJtHV724aBjQu44QG6JCnHxzh4A1G/ECPIQoiB0OAk=; b=VlSgBa76em+JLC695lGR1/dpYoQQNIe6ZXl0zOASRDnt9cuWPYVPDbMZ+tYEMRguqB pxWPoE1cFciv+gaaozG7wR7kj4bK0lF6MX7QLLRuWxFEkBAMZLjPIBVCu1T68PvF+C3l EKtz76KCy8/TY21vkNxwtwgXUVvx4ThOCo9kroLGdn4lRqAde6l1UrFnDLzOE+8R3eEI nisvicsuRDdN7cvpNb40y4e6zKszDf7C1UwhkimlTkX6lQCsTJSFoNAmGW0NAf4plP78 oxOTMTgxLDCx8XLTWXxn+Rm6WnHy2de5+hsN7ObT/PIwrMjZwh3Fu8rl51dmZIg1xrgc DAtA== X-Gm-Message-State: AOPr4FUdrSYvZx8nxxzZ6CWjZTuymplkxbIcPbgi+JiwFNdyAxOomGaQLs2oUbnZm6lvjw== X-Received: by 10.194.55.10 with SMTP id n10mr20902509wjp.28.1461337209731; Fri, 22 Apr 2016 08:00:09 -0700 (PDT) Received: from [192.168.0.77] ([93.188.182.58]) by smtp.googlemail.com with ESMTPSA id i194sm3776588wmf.6.2016.04.22.08.00.08 for (version=TLSv1/SSLv3 cipher=OTHER); Fri, 22 Apr 2016 08:00:09 -0700 (PDT) To: internals@lists.php.net References: <5719EA39.2070408@seld.be> Message-ID: <571A3C0A.5060806@gmail.com> Date: Fri, 22 Apr 2016 15:58:18 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV][RFC] Callable Types From: rowan.collins@gmail.com (Rowan Collins) Aaron Piotrowski wrote on 22/04/2016 15:56: > While this is somewhat off-topic of this particular RFC, since we can already do general type-aliasing with `use`, > > use SomeFoo as Foo; > > perhaps similar syntax could be used for type expressions, eliminating the need for a new keyword. > > use callable(int, int): int as IntReducer; > > use array | Traversable as Iterable; The problem with that is that you might want to export (and then import) a type definition: namespace MyPackage\Types { type Foo as \Symfony\Bar | \Zend\FooBar; } namespace Other { use \MyPackage\Types\Foo as FooType; } That would become terrible confusing if you overloaded the "use" keyword. Regards, -- Rowan Collins [IMSoP]