<div dir="ltr">I noticed this immediately and assumed that it was recognized as suboptimal but tolerable for now. The required underscores were meant to leave space for improvement in this regard, no? If not… sad face.<div><br></div><div>TJ</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 4, 2016 at 12:21 PM, Erica Sadun via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">SE-0111 established that Swift's type system would not allow function argument labels to be expressed as part of a function type. As I've been working with curried functions, I'm discovering an unintended consequence of this proposal in that it strips curried functions of their external labels and the resulting calls of their readability.<div><br></div><div>```</div><div><div><font face="Menlo">public func projected(</font></div><div><font face="Menlo"> function f: @escaping (CGFloat) -> CGFloat) -></font></div><div><font face="Menlo"> (_ p0: CGPoint, _ p1: CGPoint) -> </font></div><div><font face="Menlo"> (_ percent: CGFloat) -> CGPoint</font></div><div><font face="Menlo">{</font></div></div><div>```</div><div><br></div><div>Calling the first level of currying still reads acceptably:</div><div><br></div><div>```</div><div><font face="Menlo">let projectedFunction = projected(function: fToApply)</font></div><div>```</div><div><br></div><div>But after that, the enforced label-less arguments mean all further semantics have to stay within the name of the assigned partially applied function symbol and all arguments must be supplied without meaning, which is not in the spirit of API guidelines or under the umbrella of Swiftiness:</div><div><br></div><div>```</div><div><font face="Menlo">let fixedFunction = projectedFunction(p0, p1)</font></div><div><font face="Menlo">let value = fixedFunction(0.2)</font></div><div>```</div><div><br></div><div>There's no way to give either the line segment start and end points or the percent-of-progress arguments any labels. Further, Xcode/QuickHelp does not provide any support for documenting the roles of each curried return type.</div><div><br></div><div>Could this be addressed specifically for currying or has the boat sailed forever on this topic?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-- E</div><div><br></div></font></span></div><br>______________________________<wbr>_________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-<wbr>evolution</a><br>
<br></blockquote></div><br></div>