<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;">Oh, it could be so, I’m just not aware of it. I’ve tried&nbsp;Swift version 2.2-dev (LLVM 46be9ff861, Clang 4deb154edc, Swift 778f82939c) with</div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">extension Array where Element == Double {&nbsp;</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; &nbsp; &nbsp;func foo() -&gt; String {&nbsp;</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return "hello doubles!"&nbsp;</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; &nbsp; &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;">and got</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">repl.swift:1:31: error: same-type requirement makes generic parameter 'Element' non-generic</div><div id="bloop_customfont" style="margin: 0px;">extension Array where Element == Double {</div><div id="bloop_customfont" style="margin: 0px;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ^</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">Could you please point to docs / example / reference?</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_1449492596071899904" class="bloop_sign"></div> <br><p class="airmail_on">On 7 December 2015 at 13:34:51, Davide De Franceschi via swift-evolution (<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</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;" class=""><div></div><div>



<title></title>


I thought constraining an extension to a single type (#1) was
already in 2.2?
<div class="">I've seen it in a SPM example and also someone
confirmed to me that it compiled</div>
<div class=""><br class=""></div>
<div class="">It went like</div>
<div class="">extension Array where Element == Double { // add
stuff }</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 7 Dec 2015, at 12:14, Krzysztof Siejkowski via
swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class="">Concerning extension constraining, it’s already doable
with:</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class=""><br class=""></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class="">```</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;" class="">
<div id="bloop_customfont" style="margin: 0px;" class="">protocol
DoubleProtocol {}</div>
<div id="bloop_customfont" style="margin: 0px;" class=""><br class=""></div>
<div id="bloop_customfont" style="margin: 0px;" class="">extension
Double :&nbsp;DoubleProtocol&nbsp;{}</div>
<div id="bloop_customfont" style="margin: 0px;" class=""><br class=""></div>
<div id="bloop_customfont" style="margin: 0px;" class="">extension
Array where Element :&nbsp;DoubleProtocol&nbsp;{</div>
<div id="bloop_customfont" style="margin: 0px;" class="">&nbsp;
&nbsp; func onlyForDoubles() -&gt; String {</div>
<div id="bloop_customfont" style="margin: 0px;" class="">&nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return "hello doubles!"</div>
<div id="bloop_customfont" style="margin: 0px;" class="">&nbsp;
&nbsp; }</div>
<div id="bloop_customfont" style="margin: 0px;" class="">}</div>
<div id="bloop_customfont" style="margin: 0px;" class=""><br class=""></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
[1.2].onlyForDoubles() // „hello doubles!”</div>
<div id="bloop_customfont" style="margin: 0px;" class="">
["a"].onlyForDoubles() // error: type of expression is ambiguous
without more context</div>
<div id="bloop_customfont" style="margin: 0px;" class="">```</div>
<div id="bloop_customfont" style="margin: 0px;" class=""><br class=""></div>
<div id="bloop_customfont" style="margin: 0px;" class="">However, I
personally like the idea of making a syntactic sugar for that
case.</div>
<div id="bloop_customfont" style="margin: 0px;" class=""><br class=""></div>
<div id="bloop_customfont" style="margin: 0px;" class="">All the
best,</div>
<div id="bloop_customfont" style="margin: 0px;" class="">
Krzysztof</div>
</div>
<br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<div id="bloop_sign_1449489930156427776" class="bloop_sign" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
</div>
<br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<p class="airmail_on" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
On 7 December 2015 at 13:01:11, Krzysztof Siejkowski (<a href="mailto:krzysztof@siejkowski.net" class="">krzysztof@siejkowski.net</a>) wrote:</p>
<blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div class=""></div>
<div class="">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;" class=""><span class="">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" class="">https://lists.swift.org/pipermail/swift-evolution/2015-December/000132.html</a>.
The core Swift team approves:</span></div>
<div id="bloop_sign_1449489099373719808" class="bloop_sign">
<div id="bloop_customfont" style="margin: 0px;" class="">
<span class=""><br class=""></span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span class="">&gt;&nbsp;<span style="white-space: pre-wrap;" class="">Yes, this is definitely something that I (at least) would
like to see. Patches welcome :-)</span></span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">&gt; Chris
(Lattner)</div>
<div id="bloop_customfont" style="margin: 0px;" class=""><br class=""></div>
<div id="bloop_customfont" style="margin: 0px;" class="">All the
best,</div>
<div class="">Krzysztof</div>
<div class=""><br class=""></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" class="">swift-evolution@swift.org</a>) wrote:</p>
<blockquote type="cite" class="clean_bq">
<div class="">
<div class="">
<div class=""><span class="">Can you please add these features in
Swift 3?</span></div>
<div class=""><span class=""><br class=""></span></div>
<div class=""><span class="">1. The ability to do
this:</span></div>
<div class=""><span class="">extension Array&lt;Double&gt;
{</span></div>
<div class=""><span class="">&nbsp; &nbsp; //extend arrays of
doubles</span></div>
<div class=""><span class="">}</span></div>
<div class=""><span class=""><br class=""></span></div>
<div class=""><span class="">2. Generic typealiases:</span></div>
<div class=""><span class="">struct Foo&lt;T,V&gt; {</span></div>
<div class=""><span class="">&nbsp; &nbsp; let t: T</span></div>
<div class=""><span class="">&nbsp; &nbsp; let v: V</span></div>
<div class=""><span class="">}</span></div>
<div class=""><span class="">typealias IntFoo&lt;V&gt; =
Foo&lt;Int,V&gt; //Error in Swift 2.1</span></div>
<span class=""><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: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span class="Apple-converted-space">&nbsp;</span>_______________________________________________<br class="">

swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
</span></div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=UNDxqBUDZDpZmPmXfIKeZ1UxMq-2BwsURX5ulfpb2jFAaV-2B-2BiSYuwli1bJc0iPPEcF8z3Rb4hADxklkNTLTsTBrhac31A4BXiDcNxXebEvwOnHDt3y03LmxUUOhRP2utCrR12Qxqr6hAX8Ijj-2F7-2BcNbPY0NqRxuzZdIIynKAjSMVHBDXBpnrg7yXfwXAuyUn4WDiPXi-2BTxj2dqneYEHYC9Qt-2FgTo6kM2f-2F5uzYsEKqPsY-3D" alt="" width="1" height="1" border="0" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class=""><span class="Apple-converted-space">&nbsp;</span></span><span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">swift-evolution mailing list</span><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="mailto:swift-evolution@swift.org" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">swift-evolution@swift.org</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div>
</blockquote>
</div>
<br class=""></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=07Gw-2BHYt-2F8PHoGiImISMGgoJA8YAyCkVdtiMuRGm10EuzxlD9Fa5cDR8ibyaKt98G3Rq-2Bvao2mwZmnh7PjIj-2BDTX3gVVJAGKd92BETBJp4pSVjT8RroY6oQ1ZFsf2yy7GmP9d0jrhFE-2FIbAPtDk1xGHRuK6Oj5JKf2Cy2amKqxAOGHOVWjuVh3MC-2BItF6JMNUK31h9ARuJcCaZOXngL93Lvn-2BEM85p8HiypDk-2FeW0Ow-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></div></div></span></blockquote></body></html>