<div dir="ltr">I concur and I think that there is should be more to this idea. I, at least, would want partial specialization as part of this.  Consider Either and Result:<div><br></div><div>`enum Either {</div><div>    case .Left</div><div>    case .Right</div><div>}</div><div><br></div><div>typealias Result&lt;SuccessValue&gt; = Either&lt;NSError, SuccessValue&gt;`</div><div><br></div><div>How (can I?) specify just one of the types or, possibly, constrain the left side so as to avoid the need to provide a concrete type &quot;NSError&quot; there?</div><div><br></div><div>This next bit is probably another proposal. Assuming that that gets sorted out, it would be useful to alias methods, properties, cases, etc for the new name. `&lt;Some keyword&gt; case Result.Success = case Either.Left`</div><div><br></div><div>TJ</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 4, 2015 at 12:04 PM, Dapeng Gao <span dir="ltr">&lt;<a href="mailto:gdapeng@icloud.com" target="_blank">gdapeng@icloud.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">It would be handy if Swift can support generic `typealias`s, which would probably look like this:<div><br></div><div><div style="margin:0px;font-size:18px;font-family:Menlo"><span style="color:#c32275">typealias</span> Handler&lt;Element&gt; = [Element] -&gt; Void</div></div><div><br></div><div>One common way to achieve this is to define a generic `struct` and use a nested `typealias`:</div><div><br></div><div><div style="margin:0px;font-size:18px;font-family:Menlo"><span style="color:#c32275">struct</span> HandlerWrapper&lt;Element&gt; {</div><div style="margin:0px;font-size:18px;font-family:Menlo">    <span style="color:#c32275">typealias</span> Hander = [<span style="color:#6122ae">Element</span>] -&gt; <span style="color:#703daa">Void</span></div><div style="margin:0px;font-size:18px;font-family:Menlo">}</div></div><div style="margin:0px;font-size:18px;font-family:Menlo"><br></div><div style="margin:0px;font-size:18px;font-family:Menlo"><div style="margin:0px;color:rgb(83,154,164)">HandlerWrapper<span style="color:#000000">&lt;</span><span style="color:#703daa">SomeType</span><span style="color:#000000">&gt;.</span>Hander</div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=3FGfocPbgxkNkmje7djckg9Iw-2BGYY3X6RxJ1tkUXKCrtdf31pYKhoKeI4L3TG-2BXTc63BqYs7gf1IOgERwIjH8g-2FShiDpAUX38LQ-2BEb5m-2FQjneTIvwY6131Hq-2BtTkogfb4mhQTEzrFVeq1Z2kIGzSdjbYe7vHLFpn2jYQieSLAGxIv34enkNhXf2bhmYMGHdxEUywpSLxlTwYI8Ie4mNgRvVZOXQYiM9oAimxeFOh7tE-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
</div>
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div><br></div>