<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 class="">On Jun 13, 2017, at 2:02 PM, Beta <<a href="mailto:rwidmann@apple.com" class="">rwidmann@apple.com</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">They may be semantically distinct and part of the type system, but they are not types.</div></div></blockquote><div><br class=""></div><div>Yes. That is already true, though. Our internal representation is unfortunate but it largely doesn't actually affect the language, just the complexity of the type-checker.</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I don’t think they should be given the privilege of overloading, but this is a separate discussion.</div></div></blockquote><div><br class=""></div>Yes, that would definitely require further discussion.</div><div><br class=""></div><div>John.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class=""><br class=""></div><div class="">~Robert Widmann<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jun 13, 2017, at 11:00 AM, John McCall <<a href="mailto:rjmccall@apple.com" class="">rjmccall@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 13, 2017, at 1:48 PM, Beta <<a href="mailto:rwidmann@apple.com" class="">rwidmann@apple.com</a>> wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">I would like to note that overloading on <font face="Menlo" class="">inout</font> is a code smell and something that should be removed in a future version of the language. <font face="Menlo" class="">inout</font> is not a type, it’s a SIL type residency annotation.</div></div></div></blockquote><div class=""><br class=""></div>Uh, no, inout arguments are semantically extremely different from by-value arguments, and this is very much part of the type system.</div><div class=""><br class=""></div><div class="">John.</div><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">~Robert Widmann</div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Jun 13, 2017, at 10:40 AM, Xiaodi Wu 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="">Note that “inout Void” is a distinct type from “Void”; it is not possible to specify a default value for an inout Void parameter even explicitly (“error: cannot pass immutable value of type ()...”), so naturally it cannot be done implicitly either.<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Tue, Jun 13, 2017 at 12:29 Jens Persson <<a href="mailto:jens@bitcycle.com" class="">jens@bitcycle.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="">The std lib swap could perhaps be an interesting example to consider:<br class=""></div><div class="">public func swap<T>(_ a: inout T, _ b: inout T)</div><div class=""><br class=""></div><div class="">What would happen with that?</div><div class="">Will inout arguments be an exception to the rule of Void getting a default value, and if so, what would the effects of that be?<br class=""></div><div class="">Or would it somehow be allowed to call swap()?</div><div class="">Or is there a third alternative?</div></div><div dir="ltr" class=""><div class="">/Jens</div><div class=""><br class=""></div></div><div class="gmail_extra"><div class="gmail_quote">On Tue, Jun 13, 2017 at 7:15 PM, John McCall via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jun 13, 2017, at 4:41 AM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>> wrote:</div><br class="m_-6514651707984117277m_3321526760641910699Apple-interchange-newline"><div class=""><div dir="ltr" class="">On Tue, Jun 13, 2017 at 3:06 AM, John McCall <span dir="ltr" class=""><<a href="mailto:rjmccall@apple.com" target="_blank" class="">rjmccall@apple.com</a>></span> wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jun 13, 2017, at 3:30 AM, Jérémie Girault <<a href="mailto:jeremie.girault@gmail.com" target="_blank" class="">jeremie.girault@gmail.com</a>> wrote:</div><br class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-interchange-newline"><div class=""><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class="">Exactly, </div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class="">The reflexion behind it is: </div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><br class=""></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class="">- Let's understand that 0110 and other tuple SE are important for the compiler, we do not want them to rollback</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class="">- However we have number of regressions for generics / functional programmers</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class="">- Let’s solve this step by step like a typical problem</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><br class=""></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class="">- Step 0 is adressing this Void tuple of size zero :</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-tab-span" style="white-space:pre-wrap">        </span>- Zero is in many problems of CS an edge case, so let’s handle this case first</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-tab-span" style="white-space:pre-wrap">        </span>- The compiler knows what Void is, and its only value (or non-value)</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-tab-span" style="white-space:pre-wrap">        </span>- It was handled historically by the compiler because of implicit side effects</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-tab-span" style="white-space:pre-wrap">        </span>- Let’s handle it explicitely with rules in current context</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-tab-span" style="white-space:pre-wrap">        </span>- one effect of the proposal is source compatibility</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-tab-span" style="white-space:pre-wrap">        </span>- but the goal is to build atop and strengthen 0110, 0066 and other tuple-related SE</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><br class=""></div></div></blockquote><div class=""><br class=""></div></span>There are four difficulties I see with this proposal.</div><div class=""><br class=""></div><div class="">The first is that it is a first step that quite clearly does not lead to anything. It resolves a difficulty with exactly one case of function composition, but we would need completely different solutions to handle any of the other compositional regressions of SE-0110.</div><div class=""><br class=""></div><div class="">The second is that it's a huge source of complexity for the type system. The type checker would not be able to do even rudimentary type matching, e.g. when checking a call, without having first resolved all of the argument and parameter types to prove that they are not Void. This would probably render it impossible to type-check many programs without some ad-hoc rule of inferring that certain types are not Void. It would certainly make type-checking vastly more expensive.</div><div class=""><br class=""></div><div class="">The third is that it is not possible to prevent values of Void from existing, because (unlike Never, which cannot be constructed) they are always created by returning from a Void-returning function, and a generic function can do anything it likes with that value — turn it into an Any, store it in an Array, whatever. The proposal seems to only consider using the value as a parameter.</div></div></blockquote><div class=""><br class=""></div><div class="">Hang on, though. If Jérémie is interested only in addressing the issue of Void as a parameter and his idea can be adequately carried out by inferring a default value of Void for every parameter of type Void, this should be a fairly self-contained change, should it not? And would the impact on the cost of type checking really be vastly greater in that case?</div></div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">If the proposal was phrased in terms of defaults, e.g. "trailing parameters do not require a matching argument if they have Void type", then yes, that would be implementable because it still admits a "local" reduction on call constraints, one which does not need to immediately reason about the actual types of arguments. It is not clear that this rule allows function compositions of the sort that Jérémie is looking for, though.</div><div class=""><br class=""></div><div class="">Anyway, that is not the proposal; the proposal is that parameters — in any position — are simply removed from the parameter sequence if they have Void type. In order to allow composition (i.e. f(g(x)), where g: X -> Void), you then need a matching rule that arguments are dropped from the argument sequence (for purposes of type-checking) if they have Void type. Either of these rules is sufficient to turn the reduction of function-type matches into an extremely messy combinatoric matching problem where e.g. (τ0, Int) can be passed to a function taking (Int, τ1) if we can decide that τ0 == τ1 == Void.</div><div class=""><br class=""></div></div><div class=""><span class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">This idea is now rather intriguing to me because it extends beyond just addressing one symptom of SE-0110. Swift allows us to omit the spelling out of return types that are Void, it allows warning-free discarding of return values that are Void, etc. This could add a nice consistency and rationalize some of the weirdness of passing a value that is stipulated by the parameter type.</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""></div><div class="">Finally, it would allow a lot of inadvertent errors with the use of generic functions, because any argument of unconstrained type could be accidentally specialized with Void. For example, if you forgot to pass an argument to this function, it would simply infer T=Void:</div><div class=""> func append<T>(value: T)</div><div class="">It seems more likely that this would lead to unexpected, frustrating bugs than that this would actually be desired by the programmer. You really just want this to kick in in more generic situations.</div></div></blockquote><div class=""><br class=""></div><div class="">Hmm, at first glance, that seemed like it could be bad. But if, say, a particular collection can store an element of type Void, is it so undesirable to allow `append()` to append Void?</div></div></div></div></div></blockquote><div class=""><br class=""></div></span>append on a Collection is not an unconstrained generic; its parameter type is determined by the type of the collection. Perhaps this was a poorly-chosen example.</div><div class=""><br class=""></div><div class="">John.</div><div class=""><div class="m_-6514651707984117277h5"><div class=""><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><span class="m_-6514651707984117277m_3321526760641910699HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">John.</div></font></span><div class=""><div class="m_-6514651707984117277m_3321526760641910699h5"><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class=""><br style="font-family:Helvetica,Arial;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" class=""><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_sign_1497338200319793920" class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278bloop_sign" style="font-family:Helvetica,Arial;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"><div style="font-family:helvetica,arial;font-size:13px" class="">—</div><div class=""><font face="Helvetica" size="1" class="">very short reply expected -<span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span><a href="http://vsre.info/" target="_blank" class="">vsre.info</a></font></div><div style="font-family:helvetica,arial;font-size:13px" class="">Jérémie Girault<br class=""></div></div><br style="font-family:Helvetica,Arial;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" class=""><p class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278airmail_on" style="font-family:Helvetica,Arial;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">On 13 juin 2017 at 00:44:52, Xiaodi Wu (<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>) wrote:</p><blockquote type="cite" class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278clean_bq" style="font-family:Helvetica,Arial;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"><span class=""><div class=""><div class=""></div><div class=""><div dir="ltr" class="">On Mon, Jun 12, 2017 at 5:38 PM, Xiaodi Wu<span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>></span><span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span>wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div class=""><div class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278h5">On Mon, Jun 12, 2017 at 5:25 PM, Jérémie Girault<span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:jeremie.girault@gmail.com" target="_blank" class="">jeremie.girault@gmail.com</a>></span><span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span>wrote:<br class=""></div></div><div class="gmail_extra"><div class="gmail_quote"><div class=""><div class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px" class=""><span class=""><br class=""></span></div><span class=""><br class=""></span><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409bloop_sign_1497305107136064000" class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409bloop_sign"><div style="font-family:helvetica,arial;font-size:13px" class=""><span class="">—</span></div><div class=""><span class=""><font face="Helvetica" size="1" class="">very short reply expected -<span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span><a href="http://vsre.info/" target="_blank" class="">vsre.info</a></font></span></div><div style="font-family:helvetica,arial;font-size:13px" class=""><span class="">Jérémie Girault<br class=""></span></div></div><span class=""><br class=""></span><p class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409airmail_on"><span class="">On 12 juin 2017 at 23:56:37, Xiaodi Wu (<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>) wrote:</span></p><div class=""><blockquote type="cite" class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409clean_bq" style="font-family:Helvetica,Arial;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"><div class=""><div class=""><div dir="ltr" class=""><span class="">On Mon, Jun 12, 2017 at 4:47 PM, Jérémie Girault<span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:jeremie.girault@gmail.com" target="_blank" class="">jeremie.girault@gmail.com</a>></span><span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409Apple-converted-space"> </span>wrote:<br class=""></span><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px" class="">- Void as arguments is pretty common when using generics, that’s a core point of this proposal. An maybe that’s why we misunderstood ourselves (around 0110 / 0066). This proposal addresses arguments.</div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px" class="">- maybe it should be revised around this ? Simple example : </div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px" class=""><br class=""></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px" class="">`typealias Callback<T> = (T) -> Void` -> `Callback<Void>` will give `(Void) => Void`. </div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px" class=""><br class=""></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px" class="">It was acceptable before swift4 but no more. However nobody cares about this `Void` argument and actually we know it’s value. So why let the developer type it ?</div></div></blockquote><div class=""><br class=""></div><div class="">Ah, I see. The purpose of SE-0029...SE-0110 was to make it possible to distinguish an argument list `(Void)` from an argument list `()`. This does cause some verbosity where previously users relied on implicit tuple splatting. Ideally, we would bring back some syntactic sugar to make this more ergonomic. But, whether or not the spelling is made more user-friendly, the point here is that _everybody_ should care about this `Void` argument.</div></div></div></div></div></div></blockquote></div><p class="">It is still be typechecked and appropriate errors should be reported to the user so _nobody_ will ignore it.</p><p class="">But with the proposal the code will be striped out of Void arguments at compile-time. I think it's a win for the developer on a lot of grounds. The fact that this proposal integrates with the type-system is also important.</p><p class="">If you are not comfortable about Void being stripped, we can also discuss alternatives: someone was suggesting me that it would be possible to replace :</p><p class="">```</p><p class="">func foo<T, U, V>(t: T, u: U) -> V {</p><p class=""> <span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span>// do something with t and u</p><p class=""> <span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span>// return some V</p><p class="">}</p><p class="">```</p><p class="">with</p><p class="">```</p><p class="">func foo<Void, Int, String>(u: Int) -> String { let t = ()</p><p class=""> <span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span>// do something with t and u</p><p class=""> <span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span>// return some V</p><p class="">}</p><p class="">```</p><p class="">or</p><p class="">```</p><p class="">func foo<Void, Int, String>(t: Void = (), u: Int) -> String {</p><p class=""> <span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span>// do something with t and u</p><p class=""> <span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278Apple-converted-space"> </span>// return some V</p><p class="">}</p><p class="">```</p><p class="">I don’t know what you would consider more effective or elegant (at an implementation level) but it’s the same result for the developper.</p></div></blockquote></div></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">Ah, but I think I catch your drift with the last example. Is this a more general point that the compiler should treat every parameter of type Void as having an implied default value of Void? That would be an interesting idea.</div><div class=""><br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">What is the goal of such changes? Is it to allow you to write `foo()` instead of `foo(())` for a function `foo` of type `(T) -> Void`?</div><div class=""><br class=""></div><div class="">If so, then I think what you're seeking to do is reverse SE-0066 (as Vladimir points out), which explicits details how it's is an intentional change to require such a spelling. I think you're starting from the premise that this is unintended or undesirable, when in fact it is deliberate and approved.</div><div class=""><br class=""></div><div class="">It is also, unless I'm mistaken, not the issue that was raised initially with respect to SE-0110, which had to do with the extra boilerplate of destructuring a tuple inside a closure, something that was not so obvious before implementation.</div><div class=""><span class=""><br class=""></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><blockquote type="cite" class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409clean_bq" style="font-family:Helvetica,Arial;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"><div class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px" class=""></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px;margin:0px" class=""><span class="">My point here is that `Void` should be “striped” by “reducing” argument list signatures.</span></div><span class=""><span class=""><br class=""></span></span><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_sign_1497302247432667904" class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_sign"><div style="font-family:helvetica,arial;font-size:13px" class=""><span class="">—</span></div><div class=""><span class=""><font face="Helvetica" size="1" class="">very short reply expected -<span class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409Apple-converted-space"> </span><a href="http://vsre.info/" target="_blank" class="">vsre.info</a></font></span></div><div style="font-family:helvetica,arial;font-size:13px" class=""><span class="">Jérémie Girault<br class=""></span></div></div><span class=""><br class=""></span><p class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921airmail_on"><span class="">On 12 juin 2017 at 19:15:18, John McCall (<a href="mailto:rjmccall@apple.com" target="_blank" class="">rjmccall@apple.com</a>) wrote:</span></p><div class=""><div class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409h5"><blockquote type="cite" class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921clean_bq"><div style="word-wrap:break-word" class=""><div class=""><span class=""><br class=""></span><div class=""><blockquote type="cite" class=""><div class=""><span class="">On Jun 12, 2017, at 4:48 AM, Jérémie Girault via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:</span></div><span class=""><br class="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921Apple-interchange-newline"></span><div class=""><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="">Hi here,</span></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class=""><br class=""></span></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="">As I tested swift4 in xcode9b1 I noticed a lot of regressions about tuples usage.</span></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class=""><br class=""></span></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="">After documenting myself about the changes which happened, I thought that they could be improved. Instead of fighting these propositions (which make sense), I wanted create a few proposal which would improve these recent changes with a few simple rules.</span></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class=""><br class=""></span></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="">My propositions are based on the recent decisions and in the continuation of SE-0110. The first one is about Void.</span></div><div id="m_-6514651707984117277m_3321526760641910699m_-2644720238882970278m_5601571053956628674m_2043415068894562036m_-5564007550782516409m_-3578613130368345921bloop_customfont" style="font-family:Helvetica,Arial;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;margin:0px" class=""><span class="">Void is historically defined as the type of the empty tuple. The reason of this is that arguments were initially considered as tuple.</span></div></div></blockquote><span class=""><br class=""></span></div><div class=""><span class="">The dominant consideration here was always return types, not parameters. I'm not sure there was ever much point in writing Void in a parameter list, but whatever reasons there were surely vanished with SE-0066.</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">Note that 'void' in C was originally exclusively a return type. ANSI gave it a new purpose it with void*, but the meaning is totally unrelated.</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">John.</span></div></div></div></blockquote></div></div></div></blockquote></div></div></div></div></div></blockquote></div></div></blockquote></div></div></div></blockquote></div></div></div></div></div></span></blockquote></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></div></div></div><br class=""></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div></div></blockquote></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><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></body></html>