<div dir="ltr">I too agree that <span style="font-size:12.800000190734863px">empty angle brackets are redundant because the information they convey is not useful enough to justify the syntax clutter. I would value clean syntax in this case more than explicitness and I think that would go along with Swift&#39;s philosophy. I would compare this to Swift&#39;s type inference where one can omit type information that&#39;s already known to the compiler in order to increase readability.</span><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px">&gt; </span><span style="font-size:12.800000190734863px">For example, if you had a struct that used a T (defaulted to Int) for a field, and that field&#39;s range should become a Double in your use case, you know that there&#39;s something you can change to get that behavior, while just X might look like you&#39;d need to create your own type.</span></div><div><span style="font-size:12.800000190734863px"><br></span></div><div><span style="font-size:12.800000190734863px">I think such cases would be extremely rare and </span><span style="font-size:12.800000190734863px">one would have to be very ignorant about the types he/she works with. Additionally, that syntax is useful only for types with one generic argument. Say we have `Promise&lt;T, E = Error&gt;` and declare property as `let p: Promise&lt;Int&gt;`. How would you convey the information that there is a second argument that could be changed? Keeping the comma would be very ugly :)</span></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 23, 2017 at 8:51 PM, Sean Heber <span dir="ltr">&lt;<a href="mailto:sean@fifthace.com" target="_blank">sean@fifthace.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I agree. I don’t think empty angle brackets convey anything useful to the reader.<br>
<br>
l8r<br>
<span class="HOEnZb"><font color="#888888">Sean<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
&gt; On Jan 23, 2017, at 1:25 PM, T.J. Usiyan via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt; I am against requiring empty angle brackets. I could live with it either way, but I think that one reason to provide default types is to hide the detail that there is a type parameter until such a time as it is needed.  Empty angle brackets call attention to the feature in a manner that discards any possible gains on this front. Empty angle brackets would be confusing to explain to someone new to the language and–more importantly–shouldn&#39;t be necessary to explain in the &quot;falling back to defaults&quot; case.<br>
&gt;<br>
&gt; On Mon, Jan 23, 2017 at 1:41 PM, Trent Nadeau via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt; The proposal looks good to me with one possible concern. I&#39;m leaning toward types that use the defaults should still require the angle brackets, X&lt;&gt;. This makes it clear that you&#39;re using a generic type. That leads me to think that the examples Doug gave should be an error as the explicit types on the `let`s should either be omitted completely or fully specified (as X&lt;&gt;, X&lt;Double&gt;, X&lt;Int&gt;, etc.).<br>
&gt;<br>
&gt; On Mon, Jan 23, 2017 at 1:21 PM, Joe Groff via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; On Jan 23, 2017, at 9:51 AM, Douglas Gregor via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; On Jan 23, 2017, at 7:55 AM, Srđan Rašić via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Hi Everyone,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;ve opened a PR (<a href="https://github.com/apple/swift-evolution/pull/591" rel="noreferrer" target="_blank">https://github.com/apple/<wbr>swift-evolution/pull/591</a>) proposing default generic arguments which I think would be nice addition to the language. They are also mentioned in &quot;Generic manifesto&quot;.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; The proposal is focusing around generic types. Generic functions are not coved by the proposal and I don&#39;t think that we need default generic arguments in generic functions as all the types are always part of the function signature so the compiler can always infer them. One corner case might be if using default argument values in which case support for default generic arguments in functions might be useful.<br>
&gt;&gt;<br>
&gt;&gt; The proposal looks fairly straightforward and reasonable. One thing to think about is how it interacts with type inference. For example, consider these examples:<br>
&gt;&gt;<br>
&gt;&gt;      struct X&lt;T = Int&gt; { }<br>
&gt;&gt;<br>
&gt;&gt;      func f1() -&gt; X&lt;Double&gt; { return X() }<br>
&gt;&gt;<br>
&gt;&gt;      func f2() -&gt; X&lt;Int&gt; { return X() }<br>
&gt;&gt;      func f2() -&gt; X&lt;Double&gt; { return X() }<br>
&gt;&gt;<br>
&gt;&gt;      func f3&lt;T&gt;(_: T) -&gt; X&lt;T&gt; { return X() }<br>
&gt;&gt;<br>
&gt;&gt;      let x1: X = f1()   // okay: x1 has type X&lt;Double&gt;?<br>
&gt;&gt;      let x2: X = f2()   // ambiguous?<br>
&gt;&gt;      let x3a: X = f3(1.5)   // okay: x3a has type X&lt;Double&gt;?<br>
&gt;&gt;      let x3b: X = f3(1)   // okay: x3a has type X&lt;Int&gt;?<br>
&gt;&gt;<br>
&gt;&gt; The type checker already has some notion of “if you can’t infer a particular type, fill in a default” that is used for literals. That rule could be used here… or we could do something else. This should be discussed in the proposal.<br>
&gt;&gt;<br>
&gt;&gt; Thanks for working on this!<br>
&gt;<br>
&gt; There&#39;s an interesting parallel to the default behavior of literals. The type of a number or string literal is inferred from type context, or falls back to a default type like Int or String if that doesn&#39;t come up with an answer. You could think of that of saying the &#39;Self&#39; type of the protocol constraint has a default (and maybe that&#39;s how we&#39;d generalize the &quot;default type for a protocol&quot; feature if we wanted to.) It makes sense to me to follow a similar model for generic parameter defaults; that way, there&#39;s one consistent rule that applies.<br>
&gt;<br>
&gt; -Joe<br>
&gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; swift-evolution mailing list<br>
&gt; <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt; <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>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Trent Nadeau<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; swift-evolution mailing list<br>
&gt; <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt; <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>
&gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; swift-evolution mailing list<br>
&gt; <a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
&gt; <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>
</div></div></blockquote></div><br></div>