[swift-evolution] [Review] SE-0174: Change `filter` to return an associated type
Brent Royal-Gordon
brent at architechies.com
Wed May 3 00:32:59 CDT 2017
> On Apr 28, 2017, at 5:06 PM, Douglas Gregor via swift-evolution <swift-evolution at swift.org> wrote:
>
> What is your evaluation of the proposal?
I'm in favor of this proposal, and I don't agree with the previous reviewers who think this should be coupled with more advanced type system features. However, I have a few questions:
* How will associated type inference interact with this? If you write a type-specific `filter`, will it be automatically favored over the `Array` version, or will you have to manually specify a `Filtered` typealias?
* Do we want to constrain `Filtered` to `Sequence` or `Collection`? Do we want to require `where Filtered.Iterator.Element == Self.Iterator.Element`?
* Will `AnySequence`/`AnyCollection` have a `Filtered` of type `AnySequence`/`AnyCollection`, or one of type `Array`?
No time for a full review, but I thought it'd be helpful to note these things before the review period was up.
--
Brent Royal-Gordon
Architechies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170502/bffd084f/attachment.html>
More information about the swift-evolution
mailing list