<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Concerning extension constraining, it’s already doable with:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">```</div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;">protocol DoubleProtocol {}</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">extension Double :&nbsp;DoubleProtocol&nbsp;{}</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">extension Array where Element :&nbsp;DoubleProtocol&nbsp;{</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; &nbsp; func onlyForDoubles() -&gt; String {</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return "hello doubles!"</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; &nbsp; }</div><div id="bloop_customfont" style="margin: 0px;">}</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">[1.2].onlyForDoubles() // „hello doubles!”</div><div id="bloop_customfont" style="margin: 0px;">["a"].onlyForDoubles() // error: type of expression is ambiguous without more context</div><div id="bloop_customfont" style="margin: 0px;">```</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">However, I personally like the idea of making a syntactic sugar for that case.</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">All the best,</div><div id="bloop_customfont" style="margin: 0px;">Krzysztof</div></div> <br> <div id="bloop_sign_1449489930156427776" class="bloop_sign"></div> <br><p class="airmail_on">On 7 December 2015 at 13:01:11, Krzysztof Siejkowski (<a href="mailto:krzysztof@siejkowski.net">krzysztof@siejkowski.net</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div><div>




<title></title>



<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
Concerning generic typealiases, the topic is already being
discussed in „Generic `typealias`s” thread:&nbsp;<a href="https://lists.swift.org/pipermail/swift-evolution/2015-December/000132.html">https://lists.swift.org/pipermail/swift-evolution/2015-December/000132.html</a>.
The core Swift team approves:</div>
<div id="bloop_sign_1449489099373719808" class="bloop_sign">
<div id="bloop_customfont" style="margin: 0px;"><br></div>
<div id="bloop_customfont" style="margin: 0px;">
&gt;&nbsp;<span style="white-space: pre-wrap;">Yes, this is
definitely something that I (at least) would like to see. Patches
welcome :-)</span></div>
<div id="bloop_customfont" style="margin: 0px;">&gt; Chris
(Lattner)</div>
<div id="bloop_customfont" style="margin: 0px;"><br></div>
<div id="bloop_customfont" style="margin: 0px;">All the best,</div>
<div>Krzysztof</div>
<div><br></div>
</div>
<p class="airmail_on">On 7 December 2015 at 12:41:05, Tuur Anton
via swift-evolution (<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>)
wrote:</p>
<blockquote type="cite" class="clean_bq">
<div>
<div>
<div><span>Can you please add these features in Swift
3?</span></div>
<div><span><br></span></div>
<div><span>1. The ability to do this:</span></div>
<div><span>extension Array&lt;Double&gt; {</span></div>
<div><span>&nbsp; &nbsp; //extend arrays of doubles</span></div>
<div><span>}</span></div>
<div><span><br></span></div>
<div><span>2. Generic typealiases:</span></div>
<div><span>struct Foo&lt;T,V&gt; {</span></div>
<div><span>&nbsp; &nbsp; let t: T</span></div>
<div><span>&nbsp; &nbsp; let v: V</span></div>
<div><span>}</span></div>
<div><span>typealias IntFoo&lt;V&gt; = Foo&lt;Int,V&gt; //Error in
Swift 2.1</span></div>
<span><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=07Gw-2BHYt-2F8PHoGiImISMGgoJA8YAyCkVdtiMuRGm10FHsuRRL5GzVAzZbDMNWwmtHrIpq77gEAQcWx0IK2x43mPjba2hnvOf8-2BH-2B-2F3GoCCmPPxbWU2xBtN02MzLZxTlEQnC3MVxbjq05bs2XZTAgCas7EUiABkkSg5PpUAvEQl4jV6fn2AMnrs3zDX9JkBRJDLElNULXHdURZFmTIAx00Q-2FMFQxc-2FR4U3aKPyp-2B5mnA-3D" alt="" width="1" height="1" border="0" style="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;">
_______________________________________________<br>
swift-evolution mailing list<br>
swift-evolution@swift.org<br>
https://lists.swift.org/mailman/listinfo/swift-evolution<br></span></div>
</div>
</blockquote>


</div></div></span></blockquote></body></html>