<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="">Forwarding this reply to the list because I hit the wrong button.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Begin forwarded message:</div><br class="Apple-interchange-newline"><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">From: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Robert Widmann <<a href="mailto:devteam.codafi@gmail.com" class="">devteam.codafi@gmail.com</a>><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Subject: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class=""><b class="">Re: [swift-evolution] [Proposal] Tuple Extensions</b><br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">Date: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">May 4, 2016 at 4:45:21 PM EDT<br class=""></span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;" class=""><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif; color:rgba(0, 0, 0, 1.0);" class=""><b class="">To: </b></span><span style="font-family: -webkit-system-font, Helvetica Neue, Helvetica, sans-serif;" class="">Joe Groff <<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>><br class=""></span></div><br class=""><div class=""><div class="">Isn’t this assuming that tuples extensions would only come in one flavor? 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). 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=""><br class=""><blockquote type="cite" class="">On May 4, 2016, at 11:47 AM, Joe Groff <<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>> wrote:<br class=""><br class=""><br class=""><blockquote type="cite" class="">On May 3, 2016, at 10:06 PM, Robert Widmann <<a href="mailto:devteam.codafi@gmail.com" class="">devteam.codafi@gmail.com</a>> wrote:<br class=""><br class="">Once-and-for-all implementations come in many flavors. For now, we have clear interest in making a limited subset of possible tuples properly Comparable. 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. 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 == <T : Equatable>(l : (T...), r : (T...)) -> 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 <<a href="mailto:jgroff@apple.com" class="">jgroff@apple.com</a>> のメッセージ:<br class=""><br class=""><blockquote type="cite" class=""><br class=""><blockquote type="cite" class="">On May 3, 2016, at 9:52 PM, Robert Widmann <<a href="mailto:devteam.codafi@gmail.com" class="">devteam.codafi@gmail.com</a>> 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). 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=""></body></html>