<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=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 16.06.2016 um 17:36 schrieb Paul Cantrell &lt;<a href="mailto:cantrell@pobox.com" class="">cantrell@pobox.com</a>&gt;:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><blockquote type="cite" class="">On Jun 16, 2016, at 8:29 AM, Thorsten Seitz via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></blockquote><div class=""><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div style="font-family: HelveticaNeue; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><div class="">Protocols are a mechanism for deriving types from each other whereas generics are a way to parameterize types. My point was that Swift's other way to parameterize types, namely by associated types, is very similar to generics with wildcards when looking a the existentials of such protocols.</div></div></div></div></blockquote><br class=""></div><div class="">This has been a point of confusion for me as well. I keep hearing that associated types are different from generic protocols, but this seems like a distinction without a difference.</div><div class=""><br class=""></div><div class="">Suppose Swift allowed generic protocols. How would a hypothetical Collection&lt;Foo&gt; be different in practice from the proposed existential Any&lt;Collection where .Element == Foo&gt;?</div><div class=""><br class=""></div><div class="">Yes, in the realm of type theory and compiler internals they might represented differently, sure. But in practice, in terms of what code can actually do? I know of only two differences:</div><div class=""><br class=""></div><div class="">1. A type can only conform to any given protocol with one set of type parameters. (Nothing can be both Collection&lt;Foo&gt; and Collection&lt;Bar&gt;.)</div><div class=""><br class=""></div><div class="">2. When a type conforms to Collection, it declares “associatedtype Foo” instead of “: Collection&lt;Foo&gt;”, and Foo can be inferred by the compiler in some circumstances. That’s handy, but it’s a syntactic difference.</div></div></div></blockquote><div><br class=""></div>That syntactic difference is *very* handy IMO for the following reason: with generics I have to repeat all types over and over again which gets ugly when I have levels of nesting where type parameters are constrained by other generics, which requires adding their parameters to the parameter list. Essentially the nested parameters have to be fully flattened because each type parameter has to be explicitly specified.</div><div><br class=""></div><div>I’ll try to show that with a simplified example:</div><div><br class=""></div><div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(88, 110, 117);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">// with associated types</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(133, 153, 1);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures; color: #839496" class=""> Edge {</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">associatedtype</span><span style="font-variant-ligatures: no-common-ligatures" class=""> VertexType</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> source: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class=""> { </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">get</span><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> target: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class=""> { </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">get</span><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Graph {</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">associatedtype</span><span style="font-variant-ligatures: no-common-ligatures" class=""> EdgeType : Edge</span></div><p style="margin: 0px; line-height: normal; min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> vertices: [</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">EdgeType</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class="">] { </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">get</span><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> edges: [</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">EdgeType</span><span style="font-variant-ligatures: no-common-ligatures" class="">] { </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">get</span><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><p style="margin: 0px; line-height: normal; min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> outEdges(vertex: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">EdgeType</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -&gt; [</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">EdgeType</span><span style="font-variant-ligatures: no-common-ligatures" class="">]</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> GraphIterator {</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">associatedtype</span><span style="font-variant-ligatures: no-common-ligatures" class=""> GraphType : Graph</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(133, 153, 1);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;graph:&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(181, 137, 1);" class="">GraphType</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;{&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(133, 153, 1);" class="">get</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;}</span></div><p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> startVertex: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">GraphType</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class=""> { </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">get</span><span style="font-variant-ligatures: no-common-ligatures" class=""> }</span></div><p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class="">&nbsp; &nbsp;&nbsp;</p><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> enter(vertex: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">GraphType</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> propagate(along edge: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">GraphType</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">EdgeType</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> finish(vertex: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">GraphType</span><span style="font-variant-ligatures: no-common-ligatures" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(88, 110, 117);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">// with generics</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Edge&lt;VertexType&gt; {</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> source: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> target: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Graph&lt;VertexType, EdgeType: Edge&lt;VertexType&gt;&gt; {</span></div><p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> vertices: [</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class="">]</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> edges: [</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">EdgeType</span><span style="font-variant-ligatures: no-common-ligatures" class="">]</span></div><p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> outEdges(vertex: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class="">) -&gt; [</span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">EdgeType</span><span style="font-variant-ligatures: no-common-ligatures" class="">]</span></div><p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">class</span><span style="font-variant-ligatures: no-common-ligatures" class=""> GraphIterator&lt;VertexType, EdgeType: Edge&lt;VertexType&gt;, GraphType: Graph&lt;VertexType, EdgeType&gt;&gt; {</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><br class="webkit-block-placeholder"></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp; &nbsp;&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(133, 153, 1);" class="">var</span><span style="font-variant-ligatures: no-common-ligatures;" class="">&nbsp;graph:&nbsp;</span><span style="font-variant-ligatures: no-common-ligatures; color: rgb(181, 137, 1);" class="">GraphType</span></div><p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;</span><br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">var</span><span style="font-variant-ligatures: no-common-ligatures" class=""> startVertex: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span></div><p style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150); min-height: 15px;" class="">&nbsp; &nbsp;&nbsp;</p><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> enter(vertex: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> propagate(along edge: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">EdgeType</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #859901" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> finish(vertex: </span><span style="font-variant-ligatures: no-common-ligatures; color: #b58901" class="">VertexType</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 13px; line-height: normal; font-family: Menlo; color: rgb(131, 148, 150);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div></span></div></div><div>Note, how the parameter list for GraphIterator exploded, because I had to list each level of nested types down to the VertexType, whereas</div><div>in the associated types example the GraphIterator simply declares an associated type conforming to the topmost type of my nesting, the Graph.</div><div><br class=""></div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Is there a deeper difference I’m missing?</div></div></div></blockquote><div><br class=""></div><div>Maybe Dave can chime in here?</div><div><br class=""></div><div><br class=""></div><div>-Thorsten</div><div><br class=""></div></div></body></html>