<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=""><div><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=""><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div style="font-family: AvenirNext-Regular; font-size: 14px; font-style: normal; font-variant: 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="">It is definitely possible to solve this problem for associated types by binding or constraining them. The ML module system has a feature that is roughly analogous to this. </div></div></blockquote><div class=""><br class=""></div>Keep in mind that a language feature like binding/constraining associated types is not a complete solution for real use-cases, so we would still need AnySequence<Element> in the library. Otherwise it would be SequenceType<Generator: SomeGenerator>, which binds a type that you don't actually want to expose.</div><br class=""></div></div></blockquote><br class=""></div><div>Wouldn’t we get a lot of utility by binding / constraining Generator.Element? Something like:</div><div><br class=""></div><div>protocol<SequenceType where Generator.Element == Int></div><div>or</div><div>protocol<SequenceType where Generator.Element: Equatable></div><br class=""><div class="">In that case we don’t know the specific binding of SequenceType’s Generator but we do know what constraints or binding its Element must have.</div><div class=""><br class=""></div><div class="">Matthew</div></body></html>