<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="">If we wish to think more generally, would it then be necessary to, say, implement a finitary version of tuple extensions as an overload of the infinitary one?<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 4, 2016, at 4:50 PM, Matthew Johnson &lt;<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: 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 class=""><br class="Apple-interchange-newline">On May 4, 2016, at 3:46 PM, Robert Widmann 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 class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Forwarding this reply to the list because I hit the wrong button.<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">Begin forwarded message:</div><br class="Apple-interchange-newline"><div class="" style="margin: 0px;"><span class="" style="font-family: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;"><b class="">From:<span class="Apple-converted-space">&nbsp;</span></b></span><span class="" style="font-family: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;">Robert Widmann &lt;<a href="mailto:devteam.codafi@gmail.com" class="">devteam.codafi@gmail.com</a>&gt;<br class=""></span></div><div class="" style="margin: 0px;"><span class="" style="font-family: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;"><b class="">Subject:<span class="Apple-converted-space">&nbsp;</span></b></span><span class="" style="font-family: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;"><b class="">Re: [swift-evolution] [Proposal] Tuple Extensions</b><br class=""></span></div><div class="" style="margin: 0px;"><span class="" style="font-family: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;"><b class="">Date:<span class="Apple-converted-space">&nbsp;</span></b></span><span class="" style="font-family: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;">May 4, 2016 at 4:45:21 PM EDT<br class=""></span></div><div class="" style="margin: 0px;"><span class="" style="font-family: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;"><b class="">To:<span class="Apple-converted-space">&nbsp;</span></b></span><span class="" style="font-family: -webkit-system-font, 'Helvetica Neue', Helvetica, sans-serif;">Joe Groff &lt;<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>&gt;<br class=""></span></div><br class=""><div class=""><div class="">Isn’t this assuming that tuples extensions would only come in one flavor? &nbsp;There will always be cases where you need to limit an extension to a finite arity (for me, Swiftz needs a proper Bifunctor instance for tuples), something that a variadic tuple extension could not support (at least, not according anything I’ve read proposed). &nbsp;When the time comes to support the infinitary version of these extensions, it’s not that the runtime will carry around the crud left over from the old hat finite version, it’s that the runtime will support both finitary and infinitary tuple extensions.<br class=""></div></div></blockquote></div></div></div></blockquote><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: 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=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: 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="">If the standard library implemented finite-arity versions of theoretically variadic functions such as == those would need to remain in the library in order to remain ABI compliant.</div><br class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: 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;"><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: 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 class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class="">On May 4, 2016, at 11:47 AM, Joe Groff &lt;<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>&gt; wrote:<br class=""><br class=""><br class=""><blockquote type="cite" class="">On May 3, 2016, at 10:06 PM, Robert Widmann &lt;<a href="mailto:devteam.codafi@gmail.com" class="">devteam.codafi@gmail.com</a>&gt; wrote:<br class=""><br class="">Once-and-for-all implementations come in many flavors. &nbsp;For now, we have clear interest in making a limited subset of possible tuples properly Comparable. &nbsp;This will also make it easier to implement extensions to specific arities now and serve as a base for variadic generics if that is the path we take. &nbsp;I could certainly see Future Swift™ allowing this to sit side-by-side with the finite version in this proposal, couldn't you?<br class=""><br class="">extension (T...) : Equatable where T.Element : Equatable { }<br class=""><br class="">func == &lt;T : Equatable&gt;(l : (T...), r : (T...)) -&gt; Bool { /* .. */ }<br class=""></blockquote><br class="">One problem with introducing variadics later would be that, if we ship the specific-arity conformances in an ABI-stable standard library, we're stuck carrying those extensions around forever for backward compatibility.<br class=""><br class="">-Joe<br class=""><br class=""><blockquote type="cite" class="">~Robert Widmann<br class=""><br class="">2016/05/04 0:54、Joe Groff &lt;<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>&gt; のメッセージ:<br class=""><br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">On May 3, 2016, at 9:52 PM, Robert Widmann &lt;<a href="mailto:devteam.codafi@gmail.com" class="">devteam.codafi@gmail.com</a>&gt; wrote:<br class=""><br class="">Trouble is that I don't want variadic generics without corresponding support from the type system which is untenable without HKTs (see last paragraph of proposal). &nbsp;C++'s variadic implementation of std::tuple is not elegant to my mind, and would have no place in a library I could think of writing.<br class=""></blockquote><br class="">I think we'd keep tuples as a builtin type. Variadics would just let you implement Equatable/Hashable/etc. once for all tuple arities. I don't see why we'd need HKTs for that.<br class=""><br class="">-Joe<br class=""></blockquote></blockquote><br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></div>_______________________________________________<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></div></blockquote></div></blockquote></div><br class=""></div></body></html>