<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I have been waiting a long time for something like this. I’m 100% behind this.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 03 Dec 2015, at 23:12, Tal Atlas &lt;<a href="mailto:me@tal.by" class="">me@tal.by</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">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:&nbsp;<a href="https://github.com/tal/swift-evolution/blob/tal/generic-protocol-proposal/proposals/NNNN-add-generic-protocols.md" rel="noreferrer" target="_blank" style="color:rgb(42,128,185);text-decoration:none;font-family:Slack-Lato,appleLogo,sans-serif;font-size:15px" class="">https://github.com/tal/swift-evolution/blob/tal/generic-protocol-proposal/proposals/NNNN-add-generic-protocols.md</a><div class=""><br class=""></div><div class="">But the tl;dr is this:</div><div class=""><br class=""></div><div class=""><div class="">protocol Validator&lt;TypeToValidate&gt; {</div><div class="">&nbsp; var value: TypeToValidate { get set }</div><div class="">&nbsp; var valueIfValid: TypeToValidate? { get }</div><div class="">}</div><div class=""><br class=""></div><div class="">struct FooStringValidator: Validator&lt;String&gt; {</div><div class="">&nbsp; //... implementation</div><div class="">}</div><div class=""><br class=""></div><div class="">let stringValidator: Validator&lt;String&gt;</div></div><div class=""><br class=""></div><div class="">Look forward to hearing some feedback.</div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=nE9rxSXA5G4kxsTVkgv43hXwizS3O2z60WweqomIrdjBR9MLtPbSIsrN1x2JEmEoZDJ1vNQKTviuY1gzt-2BRsMmoasfe1kb2pJaiwN-2FKlW0632qnbHOQJW5XOv85oQTApqQ-2FyaYVXCj6EqNunQZceRq1WDz645bJmE2TwEPyLqb70hwEwv1cT59Z6tRJ6Hbj5nvsbisHbZJlCRy8IyIRazyhOwTsQ2KnC61CJuL0HPwI-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></body></html>