[swift-evolution] [Pitch] merge types and protocols back together with type<Type, Protocol, ...>

L. Mihalkovic laurent.mihalkovic at gmail.com
Wed May 18 12:40:36 CDT 2016



Regards
(From mobile)

> On May 17, 2016, at 7:40 PM, Adrian Zubarev via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> You don’t seem to be tackling the case of “A Collection whose Element type is String”. If we’re generalizing the current “protocol<>” notion, why not make it as powerful as a generic signature, with the ability to specify same-type constraints and conformances on associated types?
>> 
>> - Doug
> 
> Which part of the manifesto did I left out? ^^ Could you provide a quick pseudo code example?
> 
> Do you mean something like `Any<Collection where Element == String>`? I’m not sure where I should consider such a scenario, maybe at future directions?

Very reminiscent of xpath...

Any<Collection[@Element == String]>

a lot more concise though


> 
> If you’d like me to think about some specific cases I may have missed, I’d be happy if you could point the right reading (or specific section of it). 
> 
> If `Any<>` could get more powerful so let it be. :)
> 
> I’m about to rewrite a few things to match `Any<>`.
> 
> -- 
> Adrian Zubarev
> Sent with Airmail
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160518/73374977/attachment.html>


More information about the swift-evolution mailing list