<div dir="ltr">Hi,<div><br></div><div>I missed the original thread, but here are my thoughts on SE-0066 right after Chris's email ends with "thoughts?".</div><div><br></div><div><br></div><div>Concern 1:</div><div><br></div><div>I feel like we're forgetting about the functional programming syntax of declaring function types like this: </div><div><br></div><div>A -> B -> C </div><div><br></div><div>for a function foo(a: A, b: B) -> C</div><div><br></div><div>This eliminates the ambiguity of what the parameter types are, and is more legible (less paren hell) than adding parens like this: </div><div><br></div><div>(A,B) -> C</div><div><br></div><div>which for a function </div><div><br></div><div>foo(a: (A, B)) -> C</div><div><br></div><div>would look like this after the implementation of SE-0066: </div><div><br></div><div>((A,B)) -> C</div><div><br></div><div>instead of </div><div><br></div><div>(A,B) -> C</div><div><br></div><div><br></div><div>Concern 2:</div><div><br></div><div>There's also the potential to transform a function like this</div><div><br></div><div>A -> B -> C</div><div><br></div><div>into this</div><div><br></div><div>B -> C</div><div><br></div><div>after partial application, something which might not be totally irrelevant to Swift in its future. </div><div><br></div><div><br></div><div>Here are a few contrived examples of function types showing the paren version (order 66), the parens on the return type too, and the generic functional programming version (right). I want to preface this with, "Remember that Swift is an enjoyable experience because reading Swift is pleasant."</div><div><br></div><div><br></div><div><pre class="" style="border-width:1px 0px;border-style:dotted;border-color:rgb(125,125,125);padding:8pt;font-family:Monaco,Menlo,Consolas,Monaco,Menlo,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;overflow:auto;margin:1.2em;background-color:rgb(247,247,247);font-size:8pt;color:rgb(51,51,51);text-align:justify">| 66 | 66 return type | generic functional style |
|--------------------+----------------------+--------------------------|
| (A) -> B | (A) -> (B) | A -> B |
| (A, B) -> C | (A, B) -> (C) | A -> B -> C |
| ((A, B)) -> C | ((A, B)) -> (C) | (A, B) -> C |
| ([A]) -> B | ([A]) -> (B) | [A] -> B |
| ([A], (B, C)) -> D | ([A], (B, C)) -> (D) | [A] -> (B, C) -> D |
| ([A], [B]) -> [C] | ([A], [B]) -> ([C]) | [A] -> [B] -> [C] |
| (([A], [B])) -> C | (([A], [B])) -> (C) | ([A], [B]) -> C |</pre></div><div><br></div><div><br></div><div>- Mish</div></div>