<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>I've filed a ticket on bugs.swift.org to serve as a hint to any interested party that this is something that is actively desired and patches are welcome.<br></div>
<div>&nbsp;</div>
<div><a href="https://bugs.swift.org/browse/SR-64">https://bugs.swift.org/browse/SR-64</a><br></div>
<div>&nbsp;</div>
<div>I figure that's probably the right course of action for obvious improvements that we know we want but aren't candidates for the full swift-evolution process.<br></div>
<div>&nbsp;</div>
<div>-Kevin Ballard</div>
<div>&nbsp;</div>
<div>On Fri, Dec 4, 2015, at 04:08 PM, Joe Groff wrote:<br></div>
<blockquote type="cite"><div>&nbsp;</div>
<div><blockquote type="cite"><div>On Dec 4, 2015, at 3:04 AM, Dapeng Gao &lt;<a href="mailto:gdapeng@icloud.com">gdapeng@icloud.com</a>&gt; wrote:<br></div>
<div>&nbsp;</div>
<div><div style="word-wrap:break-word;-webkit-line-break:after-white-space;"><div>It would be handy if Swift can support generic `typealias`s, which would probably look like this:<br></div>
<div>&nbsp;</div>
<div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:18px;font-family:Menlo;"><span class="colour" style="color:rgb(195, 34, 117)">typealias</span> Handler&lt;Element&gt; = [Element] -&gt; Void<br></div>
</div>
<div>&nbsp;</div>
<div>One common way to achieve this is to define a generic `struct` and use a nested `typealias`:<br></div>
<div>&nbsp;</div>
<div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:18px;font-family:Menlo;"><span class="colour" style="color:rgb(195, 34, 117)">struct</span> HandlerWrapper&lt;Element&gt; {<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:18px;font-family:Menlo;"><span class="colour" style="color:rgb(195, 34, 117)">typealias</span> Hander = [<span class="colour" style="color:rgb(97, 34, 174)">Element</span>] -&gt; <span class="colour" style="color:rgb(112, 61, 170)">Void</span><br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:18px;font-family:Menlo;">}<br></div>
</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:18px;font-family:Menlo;">&nbsp;</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:18px;font-family:Menlo;"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;color:rgb(83, 154, 164);">HandlerWrapper<span style="">&lt;</span><span class="colour" style="color:rgb(112, 61, 170)">SomeType</span><span style="">&gt;.</span>Hander<br></div>
</div>
</div>
</div>
</blockquote><div>&nbsp;</div>
</div>
<div>Definitely. I'd say this falls under the (totally arbitrary) umbrella of "obvious things that we didn't get around to implementing yet" instead of formal changes to the language. If you (or anyone else!) were to implement this, we'd consider the pull request immediately.<br></div>
<div>&nbsp;</div>
<div>-Joe<br></div>
<div>&nbsp;</div>
<div> <img style="height:1px !important;width:1px !important;border-top-width:0px !important;border-right-width:0px !important;border-bottom-width:0px !important;border-left-width:0px !important;margin-top:0px !important;margin-bottom:0px !important;margin-right:0px !important;margin-left:0px !important;padding-top:0px !important;padding-bottom:0px !important;padding-right:0px !important;padding-left:0px !important;" border="0" height="1" width="1" alt="" src="https://www.fastmailusercontent.com/proxy/91e75bcd79e44d09d4012121a6267920a9b679b8636911e82a1668f97d0c4649/8647470737a3f2f25723030323431303e23647e23756e64676279646e2e65647f27766f2f60756e6f35707e6d3148765176786c673171614a7d2236454230345272776e46665a586c48434d2236455464556258524d223647495653403735656132443b437333597947734f694a4b495445525c6a6f43725b64645d6339585f6838637244426b62495a6d62793d656664754438584b4d22324d4e62463f6a784963345c673a78485545677c4950393d223649307178626f6160385639797d6c485e4454685b4c63785b4a5a54545141585379305d22324d2232427d22364733534d6365543751385335416a51523f4b475e495d2236445a566d61335355737960536f667d223242377874786948437369414b663650514d23344d23344/open"><br></div>
<div><u>_______________________________________________</u><br></div>
<div>swift-evolution mailing list<br></div>
<div><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br></div>
<div><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div>
</blockquote><div>&nbsp;</div>
</body>
</html>