<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=""><div><blockquote type="cite" class=""><div style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><div class=""><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 23, 2017, at 7:46 AM, Elviro Rocca via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">It's probably late to just casually add a couple of cents to a discussion that has been going for so long, but it seems to me that from a user standpoint, that uses types to structure their programs and define logic and relationships, isomorphic types should be considered the same by the compiler. The added burden of distinguishing between, to say, a function that takes 2 arguments and one that takes a single tuple of two arguments doesn't seem useful at all, at least from the standpoint of the types involves. All the rest, like named parameters or tuple labels, are just really about style and convenience, but isomorphic types, while not strictly equal (the very concept of "equal" is in fact a huge deal in abstract mathematics) are for all means "equivalent" for the world-modeler.<br class=""></div></div></blockquote></div><br class=""><div class="">Doesn’t seem useful?…</div><div class=""><br class=""></div><blockquote class="" style="margin: 0px 0px 0px 40px; border: none; padding: 0px;"><div class=""><font face="Monaco" class="">let myFunc: (MyTypeAlias) -> Int = /* … */</font></div></blockquote><div class=""><br class=""></div><div class="">Does the function pointer have a single parameter? Or does it trigger Super-Secret Tuple-Destructing mode and actually indicate two parameters? My secret unknown single type should always be a single type, no matter what kind of type it is.</div></div></div></blockquote></div></div></div></div></div></blockquote><br class=""></div><blockquote class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px 0px 0px 40px; border: none; padding: 0px;"><font face="Monaco" class="">(A, B, C) ((A, B), C) (A, (B, C))</font></blockquote><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">You’re saying partitions aren’t important. I’m saying that they are. Even though the second two tuples above are implemented like the first, I wouldn’t want them to be indistinguishable from an user’s standpoint. I wouldn’t want my two-argument functions magically become a three-argument one due to implementation details.</div></blockquote><div><br class=""></div><div>Why are partitions, just partitions, of tuples important? And why should anybody even consider writing a function that takes a tuple as "single argument" instead of just taking two arguments?</div><div><br class=""></div><div>The difference between the following two functions is completely meaningless from a user standpoint:</div><div><br class=""></div><div>func x<A,B> (tuple: (first: A, second: B))</div><div>func y<A,B> (first: A, second: B)</div><br class=""><blockquote type="cite" class=""><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">My previous example will stay an one-argument function for any non-tuple type behind the alias. But if it’s a tuple type, my assumption breaks because your rules would ban tuples from being first-class types.</div><div class="" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class=""></div></blockquote></div><div class=""><br class=""></div>What? Why my rules say that tuples are not first class types? I'm just saying that equivalent tuples should be allowed as arguments for functions that take equivalent tuples as arguments.<div class=""><br class=""></div><div class="">You examples shows a function that takes a "MyTypeAlias" as input:</div><div class=""><br class=""></div><div class="">- if MyTypeAlias is an alias for, say, a "Person", that function can be called with an instance of "Person"</div><div class="">- if MyTypeAlias is an alias for (Int,Int), that function can be called with a couple of Int</div><div class=""><br class=""></div><div class="">What's the matter?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Elviro</div><div class=""><div class=""><br class=""></div></div></body></html>