<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=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jul 9, 2016, at 9:08 AM, Austin Zheng via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><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=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 9 Jul 2016, at 00:53, Jon Shier &lt;<a href="mailto:jon@jonshier.com" class="">jon@jonshier.com</a>&gt; wrote:</div><div class=""><div dir="auto" class=""><div class=""><br class=""></div><blockquote type="cite" class=""><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class="">While I can see why removing the labels from the type system would be a good idea, I don’t see why calling the functions with labels would be actively prohibited. That’s useful information for the developer to have, and if the compiler doesn’t know them in some way, you can be assured Xcode’s autocomplete won’t see them.&nbsp;</div></blockquote><div class=""><br class=""></div><div class="">I wish the core team or the author of the proposal came to this thread and engaged again with the community.&nbsp;</div></div></div></blockquote><div class=""><br class=""></div><div class="">I'm not inclined to spend time engaging with people who couldn't be bothered to give feedback during the week-long official review period.</div></div></div></div></blockquote><div><br class=""></div><div>Not all people "couldn’t be bothered” but had life events, such as moving across states with four kids, that prevented them from being able to engage during the official review period.&nbsp;</div><div><br class=""></div><div>I’ve read through all of the posts that I see in my mailbox regarding this topic and I’ve yet to see any real answer to the concerns of tooling, typealias usage, closures, and code readability and maintainability concerns under this new proposal. This is the closest I’ve seen (from Douglas Gregor a few days ago):</div><div><br class=""></div><div><blockquote type="cite" class="">The core team’s intent is that one can add cosmetic labels to function types, but that those labels are not (cannot be) used at the call site, e.g.,</blockquote><div class=""><br class=""></div><div class="">Do you have specific post in mind that addresses the these concerns? Maybe I’m just missing them, but I really don’t see those addressed and they are not mentioned in the proposal at all.</div><div class=""><br class=""></div><div class="">Let’s say I want to model a problem regarding some library functions that work with resizing some image type. Today, if I did that, the tooling would give me auto-completion for all of the parameter labels and the code is very legible.&nbsp;</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Size {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> x: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> y: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Image {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> data: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Data</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> size: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Size</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// lots more properties...</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ImageResizedCallback = (original: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">, resized: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -&gt; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> doResizeA(image: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">, completed: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">ImageResizedCallback</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> newData = image.data</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> newSize = image.size</span></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// do some work that's really slow...</span></div><p style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; completed(original: image, resized: Image(data: newData, size: newSize))</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> doResizeB(image: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">, completed: (original: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">, resized: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -&gt; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> newData = image.data</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> newSize = image.size</span></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// do some work that's really slow...</span></div><p style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; completed(original: image, resized: Image(data: newData, size: newSize))</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div></div><div class=""><br class=""></div><div class="">In either approach, `doResizeA` with a named callback or `doResizeB` with an explicit parameter type offer benefits that are lost under this proposal.</div><div class=""><br class=""></div><div class=""><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">let</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class=""> someAsset = Image(data: Data(), size: Size(x: </span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">100</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">, y: </span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures; color: rgb(39, 42, 216);" class="">100</span><span style="font-family: Menlo; font-size: 11px; font-variant-ligatures: no-common-ligatures;" class="">))</span></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><p style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">doResizeA(image: someAsset, completed: { (original, resized) </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">in</span></div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; print(</span><span style="font-variant-ligatures: no-common-ligatures" class="">"doResizeA - original: </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">original</span><span style="font-variant-ligatures: no-common-ligatures" class="">), resized: </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">resized</span><span style="font-variant-ligatures: no-common-ligatures" class="">)"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">})</span></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">doResizeB(image: someAsset, completed: { (original, resized) </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">in</span></div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; print(</span><span style="font-variant-ligatures: no-common-ligatures" class="">"doResizeB - original: </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">original</span><span style="font-variant-ligatures: no-common-ligatures" class="">), resized: </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">resized</span><span style="font-variant-ligatures: no-common-ligatures" class="">)"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">})</span></div></div></div><div class=""><br class=""></div><div class="">Note that both `original` and `resized` get auto-completed for us here. This provides great code clarity and insights. This is also self-documenting code.</div><div class=""><br class=""></div><div class="">However, under this proposal as accepted (as I understand it), we are left with this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> doResizeC(image: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">, completed: (</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">, </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -&gt; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Void</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> newData = image.data</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> newSize = image.size</span></div><div style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// do some work that's really slow...</span></div><p style="margin: 0px; line-height: normal; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; completed(image, Image(data: newData, size: newSize))</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div></div><div class=""><br class=""></div><div class="">This code is no longer self-documenting. I have no idea at looking at the call signature which order the images to `completed` should be.</div><div class=""><br class=""></div><div class="">Further, I get no help here when trying to use it:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">doResizeC(image: someAsset) { (&lt;#Image#&gt;, &lt;#Image#&gt;) </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">in</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &lt;#code#&gt;</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div><div class=""><br class=""></div><div class="">What do I label for the two images? This is a workflow regression. Yes, maybe the underlying model is more correct. However, this comes at a burden to actually authoring and maintaining the code. To me, that’s a truly unfortunate cost.</div><div class=""><br class=""></div><div class="">So now I probably write this:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">doResizeC(image: someAsset) {</span></div><div style="margin: 0px; line-height: normal; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; print(</span><span style="font-variant-ligatures: no-common-ligatures" class="">"doResizeC1 - original: </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">$0</span><span style="font-variant-ligatures: no-common-ligatures" class="">), resized: </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">$1</span><span style="font-variant-ligatures: no-common-ligatures" class="">)"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class="">Or, if I happen to <i class="">know</i>&nbsp;or look-up the order, I can fill in the labels myself:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">doResizeC(image: someAsset, completed: { (original, resized)&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);" class="">in</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">&nbsp; &nbsp;&nbsp;print(</span><span style="font-variant-ligatures: no-common-ligatures;" class="">"doResizeC2 - original:&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">\</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">original</span><span style="font-variant-ligatures: no-common-ligatures;" class="">), resized:&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">\</span><span style="font-variant-ligatures: no-common-ligatures;" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">resized</span><span style="font-variant-ligatures: no-common-ligatures;" class="">)"</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(0, 0, 0);" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">})</span></div></div><div class=""><br class=""></div><div class="">Further, we are able to turn runtime errors into compile-time checks when refactoring the signatures in the `doResizeA` and `doResizeB` functions - e.g. change the order of `original` and `resized` and you’ll get the compiler errors. This no longer happens under this proposal because the labels are erased. One way around that is to use types to solve this problem, but Swift provides no convenient way to have two `Image` types that share the same implementation but are considered as different types (sure, I could box them…).</div><div class=""><br class=""></div><div class="">I <i class="">can</i>&nbsp;get these benefits back, but now I need to introduce even more complexity into the system.</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ResizeCallbackType {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> resized(original: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">, resized: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ResizeCallback : </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">ResizeCallbackType</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> resized(original: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">, resized: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(209, 47, 27);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; &nbsp; print(</span><span style="font-variant-ligatures: no-common-ligatures" class="">"resized - original: </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">original</span><span style="font-variant-ligatures: no-common-ligatures" class="">), resized: </span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">\</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">resized</span><span style="font-variant-ligatures: no-common-ligatures" class="">)"</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; }</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> doResizeD(image: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Image</span><span style="font-variant-ligatures: no-common-ligatures" class="">, callback: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">ResizeCallbackType</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> newData = image.data</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> newSize = image.size</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// do some work that's really slow...</span></div><p style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; callback.resized(original: image, resized: Image(data: newData, size: newSize))</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 11px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">doResizeD(image: someAsset, callback: ResizeCallback())</span></div></div><div class=""><br class=""></div><div class="">But who really wants to go through all the protocol effort just to get back to a place being able to allow for label usage again?&nbsp;</div><div class=""><br class=""></div><div class="">I agree that the proposal provides a “more correct” underlying model for Swift. However, before being approved, I would have really liked to have seen the above workflow and what I consider to be code readability and maintainability regressions addressed.</div><div class=""><br class=""></div><div class="">-David</div></div></div></body></html>