<div style="white-space:pre-wrap">Thanks for the great info. I made this because I didn&#39;t see anything on the current plan and I really hope that whatever comes out has the power and ease of the proposal. <br><br>Thanks again for the great responses. </div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 3, 2015 at 5:43 PM Joe Groff &lt;<a href="mailto:jgroff@apple.com">jgroff@apple.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><blockquote type="cite"><div>On Dec 3, 2015, at 2:12 PM, Tal Atlas &lt;<a href="mailto:me@tal.by" target="_blank">me@tal.by</a>&gt; wrote:</div><br><div><div dir="ltr">With the awesome expansion of protocol oriented programming that swift has allowed, the lack of generic protocols has felt noticeably lacking and painful in some cases. I made an in depth proposal here: <a href="https://github.com/tal/swift-evolution/blob/tal/generic-protocol-proposal/proposals/NNNN-add-generic-protocols.md" rel="noreferrer" style="color:rgb(42,128,185);text-decoration:none;font-family:Slack-Lato,appleLogo,sans-serif;font-size:15px" target="_blank">https://github.com/tal/swift-evolution/blob/tal/generic-protocol-proposal/proposals/NNNN-add-generic-protocols.md</a><div><br></div><div>But the tl;dr is this:</div><div><br></div><div><div>protocol Validator&lt;TypeToValidate&gt; {</div><div>  var value: TypeToValidate { get set }</div><div>  var valueIfValid: TypeToValidate? { get }</div><div>}</div><div><br></div><div>struct FooStringValidator: Validator&lt;String&gt; {</div><div>  //... implementation</div><div>}</div><div><br></div><div>let stringValidator: Validator&lt;String&gt;</div></div></div></div></blockquote><br></div></div><div style="word-wrap:break-word"><div>The lack of protocol type erasure when associated types are involved is definitely a big problem, and one we&#39;d like to address. However, I don&#39;t think moving wholesale to modeling associated types this way is feasible. Many of the standard library protocols have a lot of associated types. &#39;CollectionType&#39; for instance has its &#39;Index&#39; type while also inheriting a &#39;Generator&#39; from SequenceType, and neither of these is what you typically want to parameterize a collection on—you&#39;d want &#39;CollectionType&lt;Int&gt;&#39; ideally to refer to a collection whose *Element* is Int without having to fully specify the generator and index if you don&#39;t care about them. Swift&#39;s protocols also support type system features that make some erased protocol types not actual models of their own protocols; `Equatable` is notorious for this, since a type being `Equatable` to its own values does not mean it can be equated to arbitrary other types; `1 == &quot;1&quot;` is nonsense for instance. We have a number of issues that need to be considered here; don&#39;t worry, we are considering them!</div></div><div style="word-wrap:break-word"><div><br></div><div>-Joe</div></div></blockquote></div>