<div id="compose" contenteditable="true" aria-label="Message body" style="padding-left: 16px; padding-right: 16px; padding-bottom: 8px;"><br></div><div class="gmail_quote">I think () reads nicer than Void, and has a sort of beauty that () literally looks like nothing, unlike some word. The fact that you can nest it is trippy&nbsp;in a kind of cool way.<br><br><b>Patrick Smith</b></div><div class="gmail_quote"><b><br></b><div class="gmail_quote">  On Apr 19 2016, at 11:28 pm, Vladimir.S via swift-evolution &lt;<a dir="ltr" href="mailto:swift-evolution@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="8">swift-evolution@swift.org</a>&gt; wrote:  <br>  <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">    <p>Although I personally have no strong opinion on this proposal yet,<br>it is clear for me that something is wrong with function type sintax&amp;Void&amp;().</p><p>Right now we have such situation, when all the next code is OK, can be <br>compiled and run, but each fX has the same meaning:</p><p>typealias f1 = () -&gt; ()<br>typealias f2 = () -&gt; Void<br>typealias f3 = () -&gt; (Void)<br>typealias f4 = () -&gt; (())<br>typealias f5 = () -&gt; ((((((()))))))</p><p>typealias f6 = Void -&gt; ()<br>typealias f7 = Void -&gt; Void<br>typealias f8 = Void -&gt; (Void)<br>typealias f9 = Void -&gt; (())<br>typealias f10 = Void -&gt; ((((((()))))))</p><p>typealias f11 = (Void) -&gt; ()<br>typealias f12 = ((((((())))))) -&gt; Void<br>typealias f13 = (()) -&gt; ((Void))<br>typealias f14 = ((())) -&gt; (())<br>typealias f15 = ((Void)) -&gt; ((((((()))))))</p><p>func f() -&gt; Void {</p><p>}</p><p>let fv1 : f1 = f<br>let fv2 : f2 = f<br>let fv3 : f3 = f<br>let fv4 : f4 = f<br>let fv5 : f5 = f<br>let fv6 : f6 = f<br>let fv7 : f7 = f<br>let fv8 : f8 = f<br>let fv9 : f9 = f<br>let fv10 : f10 = f<br>let fv11 : f11 = f<br>let fv12 : f12 = f<br>let fv13 : f13 = f<br>let fv14 : f14 = f<br>let fv15 : f15 = f</p><p><br>Don't you think something is wrong with this?<br>Let's discuss ?</p><p>Personally I probably prefer to replace "()" with Void as a result of <br>function, and probably replace Void with "()" as parameters part. And don't <br>allow empty-tuple-in-tuple at least for function type declaration + don't <br>allow Void-in-tuple. I.e. in this case we'll have only this as alowed <br>declaration:</p><p>typealias ftype = () -&gt; Void</p><p>IMO the only clear, explicit, often used variant.</p><p><br>On 19.04.2016 10:46, Radosław Pietruszewski via swift-evolution wrote:<br>&gt; Noooooo :(<br>&gt;<br>&gt; I understand and appreciate the rationale, uniformity between declaration and use site being a good thing, but IMHO the proposal just brings unnecessary noise, far outweighing the small benefit of having the symmetry.<br>&gt;<br>&gt; 1. What I’m worried the most is the “parentheses blindness”. In higher-order functions, or just when I take a simple callback closure, there are just a lot of parentheses (add to that generics, and there’s a lot of angled brackets too). And it just becomes hard to instantly decipher. To me, `func blah(f: Int -&gt; Float) -&gt; String` is easier to read that `func blah(f: (Int) -&gt; Float) -&gt; String`. Or just notice how noisy `(f: () -&gt; ())` is. This is why I like the convention of using `Void` for void-returning functions. There’s less noise in `(f: () -&gt; Void)`, and even better in `(f: Int -&gt; Void)`. I don’t have to mentally match parentheses, because whenever possible, there’s just one set of parens around the main function declaration. When punctuation like parentheses is used sparingly, it carries a lot of weight. Requiring parentheses around T in T -&gt; U doesn’t seem to have a significant reason aside from style/taste.<br>&gt;<br>&gt; 2. I’m not convinced at all that `(Foo) -&gt; Bar` is immediately more obvious to people. I don’t have data to back it up, but my intuition is that `Foo -&gt; Bar` is simple and understandable. “A function from Foo to Bar”, I’m thinking. I don’t have to mentally parse the vacuous parentheses, just to conclude that there’s, in fact, just one parameter. And when there is more than one parameter, the parentheses in `(Foo, Bar) -&gt; Baz` instantly carry more weight.<br>&gt;<br>&gt; 3. Swift has been really good at removing unnecessary punctuation. Parentheses in if statements, semicolons, shortcut forms of closures, etc. This is a good thing. As I said before, using punctuation only when it matters makes it stand out, and in places where it doesn’t, by removing it we’re increasing the signal-to-noise ratio. To me, parentheses in `(Foo) -&gt; Bar` don’t matter. I can see why one could argue for them, or prefer them, but it seems like a merely stylistic choice. Let’s keep them where it matters, and leave this to personal preference.<br>&gt;<br>&gt; Best,<br>&gt; — Radek<br>&gt;<br>&gt;&gt; On 15 Apr 2016, at 06:57, Chris Lattner via swift-evolution &lt;<a dir="ltr" href="mailto:swift-evolution@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="11">swift-evolution@swift.org</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; We currently accept function type syntax without parentheses, like:<br>&gt;&gt;<br>&gt;&gt;  Int -&gt; Float<br>&gt;&gt;  String -&gt; ()<br>&gt;&gt;<br>&gt;&gt; etc.  The original rationale aligned with the fact that we wanted to treat all functions as taking a single parameter (which was often of tuple type) and producing a tuple value (which was sometimes a tuple, in the case of void and multiple return values).  However, we’ve long since moved on from that early design point: there are a number of things that you can only do in a parameter list now (varargs, default args, etc), implicit tuple splat has been removed, and  the compiler has long ago stopped modeling function parameters this way.  Beyond that, it eliminates one potential style war.<br>&gt;&gt;<br>&gt;&gt; Given all this, I think it makes sense to go for syntactic uniformity between parameter list and function types, and just require parenthesis on the argument list.  The types above can be trivially written as:<br>&gt;&gt;<br>&gt;&gt;  (Int) -&gt; Float<br>&gt;&gt;  (String) -&gt; ()<br>&gt;&gt;<br>&gt;&gt; Thoughts?<br>&gt;&gt;<br>&gt;&gt; -Chris<br>&gt;&gt; _______________________________________________<br>&gt;&gt; swift-evolution mailing list<br>&gt;&gt; <a dir="ltr" href="mailto:swift-evolution@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="12">swift-evolution@swift.org</a><br>&gt;&gt; <a dir="ltr" href="https://lists.swift.org/mailman/listinfo/swift-evolution" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="13">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>&gt;<br>&gt; _______________________________________________<br>&gt; swift-evolution mailing list<br>&gt; <a dir="ltr" href="mailto:swift-evolution@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="14">swift-evolution@swift.org</a><br>&gt; <a dir="ltr" href="https://lists.swift.org/mailman/listinfo/swift-evolution" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="15">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>&gt;<br>_______________________________________________<br>swift-evolution mailing list<br><a dir="ltr" href="mailto:swift-evolution@swift.org" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="16">swift-evolution@swift.org</a><br><a dir="ltr" href="https://lists.swift.org/mailman/listinfo/swift-evolution" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="17">https://lists.swift.org/mailman/listinfo/swift-evolution</a></p>  </blockquote></div><br><br></div>