<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 class=""><div><blockquote type="cite" class=""><div class="">On 27 May 2016, at 15:31, plx via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><br class=""></div></div></div></blockquote><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="">&nbsp; protocol Sequence {</div><div class="">&nbsp; &nbsp; typealias of&lt;E&gt; == S: Self where S.Iterator.Element == E</div><div class="">&nbsp; }</div><div class=""><br class=""></div><div class="">&nbsp; // sequence-accepting variant</div><div class="">&nbsp; func doSomething&lt;S:Sequence.of&lt;Foo&gt;&gt;(values: S) { … }</div></div></blockquote><br class=""></div><div>This is a nice alternative; would it actually need to be declared in the angle brackets? Could it be done as:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space: pre;">        </span><span style="font-family: Menlo; font-size: 11px; color: rgb(187, 44, 162);" class="">func</span><span style="font-family: Menlo; font-size: 11px;" class="">&nbsp;doSomething(values:</span><span style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);" class="">Sequence</span><span style="font-family: Menlo; font-size: 11px;" class="">.</span><span style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);" class="">of</span><span style="font-family: Menlo; font-size: 11px;" class="">&lt;</span><span style="font-family: Menlo; font-size: 11px; color: rgb(112, 61, 170);" class="">Foo</span><span style="font-family: Menlo; font-size: 11px;" class="">&gt;) { … }</span></div><div><br class=""></div><div>As long as it would work the same as a generic declaration this could be a good way to do it, either that or a SequenceOf type alias as mentioned.</div></div><div><br class=""></div><div><br class=""></div><div>Still, I kind of feel like we need to do something with the array type shorthand, but I wonder if perhaps we could just get rid of it altogether, to prevent its use entirely? i.e- all instances of [Foo] can be replaced with Array&lt;Foo&gt;, but we would encourage the use of Sequence.of/SequenceOf/Collection.of/CollectionOf first wherever possible.</div><div><br class=""></div><div>As more types become available that are ArrayLiteralConvertible it seems like we should discourage restriction of a parameter to Array except when a developer explicitly chooses it. This problem will come up with the Dictionary type shorthand as well if Swift gets some kind of Map protocol to abstract it, and we don’t even have a Set-specific syntax so it seems like it may be fairer to remove these shorthands.</div></body></html>