<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I wouldn't mind driving the discussion and proposal, because I'd really like to see a more complete generics system. Before I start, can David or Doug, or someone else with a high-level view of the generics system tell me if this is where to start or if there is another feature in the Complete Generics manifesto which is more urgent first?</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">David</div><div><br>On 13 Apr 2016, at 01:46, Jacob Bandes-Storch via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">I'm interested, but I'm by no means claiming I'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"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></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 <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
<br>
> On Apr 11, 2016, at 1:01 AM, Jacob Bandes-Storch via swift-evolution<br>
> <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
> Doug wrote this in the Completing Generics manifesto, under "Minor<br>
> extensions":<br>
><br>
> *Arbitrary requirements in protocols<br>
><br>
> Currently, a new protocol can inherit from other protocols, introduce<br>
> new associated types, and add new conformance constraints to associated<br>
> types (by redeclaring an associated type from an inherited protocol).<br>
> However, one cannot express more general constraints. Building on the<br>
> example from “Recursive protocol constraints”, we really want the<br>
> element type of a Sequence’s SubSequence to be the same as the element<br>
> type of the Sequence, e.g.,<br>
><br>
> protocol Sequence {<br>
> associatedtype Iterator : IteratorProtocol<br>
> …<br>
> associatedtype SubSequence : Sequence where SubSequence.Iterator.Element<br>
> == Iterator.Element<br>
> }<br>
><br>
> +1.<br>
><br>
> To make it into Swift 3, would this feature require a proposal of its own?<br>
><br>
> Yes. Also, be wary that the syntax above potentially conflicts with the syntax<br>
> discussed as "moving the where clauses”:<br>
><br>
> <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>
><br>
> How feasible would it be to implement on top of the current system?<br>
><br>
> Definitely! The archetype builder would need to learn to check these extra where<br>
> clauses, and one would need to be sure that the constraint solver is picking<br>
> 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'm very excited that someone'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>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>