<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="">Chris Lattner has a <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0048-generic-typealias.md" class="">proposal under review</a> on this topic. <div class=""><br class=""></div><div class="">milos<br class=""><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">On 6 Apr 2016, at 20:41, James Campbell via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;">This was inspired from the topic about moving where clauses out of parameter lists.</div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><br class=""></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;">Certain generics get very long winded, I was wondering if we could create some sort of alias for generics.</div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><br class=""></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class="">func anyCommonElements <T: SequenceType, U: SequenceType where T.Generator.Element: Equatable, T.Generator.Element == U.Generator.Element> (lhs: T, _ rhs: U) -> Bool</span><br class=""></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class=""><br class=""></span></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class="">could be shared across functions like so:</span></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class=""><br class=""></span></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class="">genericalias SequencesWithSameElements<T, U> = </span><span style="font-size:12.8px;font-family:arial,sans-serif;color:rgb(34,34,34)" class=""><T: SequenceType, U: SequenceType where T.Generator.Element: Equatable, T.Generator.Element == U.Generator.Element></span></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class=""><br class=""></span></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class="">func anyCommonElements <</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class="">SequencesWithSameElements</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class="">> (lhs: T, _ rhs: U) -> Bool</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class=""><br class=""></span></div><div class="gmail_default" style="font-family: arial, helvetica, sans-serif; font-size: small;"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class="">func == <</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class="">SequencesWithSameElements</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class="">> (lhs: T, _ rhs: U) -> Bool</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px" class=""><br class=""></span></div><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><p class=""><b class=""><font color="#cc0000" class="">___________________________________</font></b></p><p class=""><b class="">James⎥</b></p><p class=""><b class=""><font color="#cc0000" class=""><a href="mailto:james@supmenow.com" target="_blank" style="cursor: url("chrome-extension://ledmjlnkdlappilhaaihfhanlpdjjalm/rockhand.png"), auto;" class="">james@supmenow.com</a>⎥<a href="http://supmenow.com/" target="_blank" class="">supmenow.com</a></font></b></p><p class=""><b class=""><font size="2" class="">Sup</font></b></p><p class=""><b class=""><font size="2" class="">Runway East
</font></b></p><p class=""><b class=""><font size="2" class="">10 Finsbury Square</font></b></p><p class=""><b class=""><font size="2" class="">London</font></b></p><p class=""><b class=""><font size="2" class="">
EC2A 1AF </font></b></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></div></body></html>