<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 24, 2016 at 4:24 PM, Brent Royal-Gordon <span dir="ltr"><<a href="mailto:brent@architechies.com" target="_blank">brent@architechies.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">> I’m not sure what you mean about introducing type unsafely.<br>
<br>
</span>What I mean is that once you do this:<br>
<br>
let x: AnyCollection<Character> = myArrayOfCharacters<br>
let y: AnyCollection<Character> = myString.characters<br>
<br>
Both `x` and `y` have indices of type `Any<Comparable>`, and will now accept each others' indices:<br>
<br>
for i in x.indices {<br>
print(y[i]) // Oops!<br>
}<br>
<br>
If this rule:<br>
<span class=""><br>
> The generalized existentials proposal goes out of its way to be explicit about the fact that only type safe operations would be visible through the existential.<br>
<br>
</span>Is trying to say that this isn't the case because APIs using the collection's `Index` are not exposed on an `AnyCollection`, well, then I'm not sure what `AnyCollection` is actually supposed to be used for.<br>
<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>If there's any way that the rules that I've proposed can be relaxed without sacrificing type safety, I would love to hear it. I think the difference in 'power' in this regard between a function that uses generic types and a function that uses existentials is something inherent to how each works, though.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888">
--<br>
Brent Royal-Gordon<br>
Architechies<br>
<br>
</font></span></blockquote></div><br></div></div>