<div dir="ltr">I&#39;m interested, but I&#39;m by no means claiming I&#39;ll have enough time to drive any of the discussion/proposal/implementation. :-(<div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div>Jacob<br></div></div></div></div>
<br><div class="gmail_quote">On Tue, Apr 12, 2016 at 3:07 PM, Dave Abrahams via swift-evolution <span dir="ltr">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
on Tue Apr 12 2016, Douglas Gregor &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
<br>
&gt;     On Apr 11, 2016, at 1:01 AM, Jacob Bandes-Storch via swift-evolution<br>
&gt;     &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt;     Doug wrote this in the Completing Generics manifesto, under &quot;Minor<br>
&gt;     extensions&quot;:<br>
&gt;<br>
&gt;         *Arbitrary requirements in protocols<br>
&gt;<br>
&gt;         Currently, a new protocol can inherit from other protocols, introduce<br>
&gt;         new associated types, and add new conformance constraints to associated<br>
&gt;         types (by redeclaring an associated type from an inherited protocol).<br>
&gt;         However, one cannot express more general constraints. Building on the<br>
&gt;         example from “Recursive protocol constraints”, we really want the<br>
&gt;         element type of a Sequence’s SubSequence to be the same as the element<br>
&gt;         type of the Sequence, e.g.,<br>
&gt;<br>
&gt;         protocol Sequence {<br>
&gt;         associatedtype Iterator : IteratorProtocol<br>
&gt;         …<br>
&gt;         associatedtype SubSequence : Sequence where SubSequence.Iterator.Element<br>
&gt;         == Iterator.Element<br>
&gt;         }<br>
&gt;<br>
&gt;     +1.<br>
&gt;<br>
&gt;     To make it into Swift 3, would this feature require a proposal of its own?<br>
&gt;<br>
&gt; Yes. Also, be wary that the syntax above potentially conflicts with the syntax<br>
&gt; discussed as &quot;moving the where clauses”:<br>
&gt;<br>
&gt; <a href="http://thread.gmane.org/gmane.comp.lang.swift.evolution/13886/focus=14058" rel="noreferrer" target="_blank">http://thread.gmane.org/gmane.comp.lang.swift.evolution/13886/focus=14058</a><br>
&gt;<br>
&gt;     How feasible would it be to implement on top of the current system?<br>
&gt;<br>
&gt; Definitely! The archetype builder would need to learn to check these extra where<br>
&gt; clauses, and one would need to be sure that the constraint solver is picking<br>
&gt; them up as well.<br>
<br>
</div></div>By the way, having this would enable us to massively simplify the<br>
standard library, and potentially lots of user-written generic code,<br>
too.  So I&#39;m very excited that someone&#39;s interested!<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Dave<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div></div>