<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 26, 2016, at 6:02 AM, Matthew Johnson &lt;<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>&gt; wrote:</div><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><br class=""></div><div class="">I really like the enhancement. &nbsp;This makes a lot of sense. &nbsp;All members are visible, but some members can't be called because you can't form an argument of the necessary type (i.e. when it is a non-concrete associated type and you can't get a value as output of another member of the existential). &nbsp;Thanks for chiming in on this Joe!</div><div class=""><br class=""></div><div class="">There is one part of the update that could use clarification:</div><div class=""><pre style="box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><font face="UICTFontTextStyleTallBody" class=""><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);" class=""><span class="pl-c" style="box-sizing: border-box;">// Okay, because String conforms to both Protocol1 and Streamable</span>&nbsp;</span></font></pre><pre style="box-sizing: border-box; margin-top: 0px; margin-bottom: 0px; line-height: 1.45; word-wrap: normal; padding: 16px; overflow: auto; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; word-break: normal;" class=""><font face="UICTFontTextStyleTallBody" class=""><span style="white-space: normal; background-color: rgba(255, 255, 255, 0);" class=""><span class="pl-k" style="box-sizing: border-box;">let</span><span class="Apple-converted-space">&nbsp;</span>r2<span class="Apple-converted-space">&nbsp;</span><span class="pl-k" style="box-sizing: border-box;">=</span><span class="Apple-converted-space">&nbsp;</span>result<span class="Apple-converted-space">&nbsp;</span><span class="pl-k" style="box-sizing: border-box;">as?</span><span class="Apple-converted-space">&nbsp;</span><span class="pl-c1" style="box-sizing: border-box;">String</span></span></font></pre></div><div class="">I think you mean that the attempted cast is ok because there is a possibility it might succeed, but it might also fail. &nbsp;The possibility of failure should probably be highlighted.</div></div></div></blockquote><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><br class=""></div><div class="">You might also want to elaborate that the Int attempt is a compiler error because there is no possibility for the attempted cast to succeed (if that is what you intend).</div></div></div></blockquote><div><br class=""></div><div>Yes, this is exactly what I meant. I'll make the copy clearer. Thanks!</div><br class=""><blockquote type="cite" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Best,</div><div class="">Austin</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, May 24, 2016 at 5:09 AM, Matthew Johnson via swift-evolution<span class="Apple-converted-space">&nbsp;</span><span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span><span class="Apple-converted-space">&nbsp;</span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><br class=""><br class="">Sent from my iPad<br class=""><span class=""><br class="">On May 23, 2016, at 9:52 PM, Brent Royal-Gordon via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""><br class="">&gt;&gt; One initial bit of feedback -&nbsp; I believe if you have existential types, I believe you can define Sequence Element directly, rather than with a type alias. e.g.<br class="">&gt;&gt;<br class="">&gt;&gt; protocol Sequence {<br class="">&gt;&gt;&nbsp; associatedtype Element<br class="">&gt;&gt;&nbsp; associatedtype Iterator: any&lt;IteratorProtocol where IteratorProtocol.Element==Element&gt;<br class="">&gt;&gt;&nbsp; associatedtype SubSequence: any&lt;Sequence where Sequence.Element == Element&gt;<br class="">&gt;&gt;&nbsp; …<br class="">&gt;&gt; }<br class="">&gt;<br class="">&gt; That's not really the same thing. Any&lt;IteratorProtocol&gt; is an existential, not a protocol. It's basically an automatically-generated version of our current `AnyIterator&lt;T&gt;` type (though with some additional flexibility). It can't appear on the right side of a `:`, any more than AnyIterator could.<br class=""><br class=""></span>After this proposal you should be able to use these existentials anywhere you can place a constraint, so it would work.&nbsp; You can do this with the protocol composition operator today and the future existential is just an extension of that capability.<br class=""><span class="im HOEnZb"><br class="">&gt;<br class="">&gt; What *would* work is allowing `where` clauses on associated types:<br class="">&gt;<br class="">&gt;&gt; protocol Sequence {<br class="">&gt;&gt;&nbsp; associatedtype Element<br class="">&gt;&gt;&nbsp; associatedtype Iterator: IteratorProtocol where Iterator.Element==Element<br class="">&gt;&gt;&nbsp; associatedtype SubSequence: Sequence where SubSequence.Element == Element<br class="">&gt;&gt;&nbsp; …<br class="">&gt;&gt; }<br class="">&gt;<br class="">&gt; I believe this is part of the generics manifesto.<br class="">&gt;<br class="">&gt; --<br class="">&gt; Brent Royal-Gordon<br class="">&gt; Architechies<br class="">&gt;<br class=""></span><div class="HOEnZb"><div class="h5">&gt; _______________________________________________<br class="">&gt; swift-evolution mailing list<br class="">&gt;<span class="Apple-converted-space">&nbsp;</span><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">&gt;<span class="Apple-converted-space">&nbsp;</span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""><br class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></div></blockquote></div></div></div></blockquote></div></div></blockquote></div><br class=""></body></html>