-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] Give Sequence a top-level Element #8939
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stdlib] Give Sequence a top-level Element #8939
Conversation
9312771
to
089f44e
Compare
OK I think the only ones left in the core stdlib are compiler crashers. |
@swift-ci Please benchmark |
// be used as IndexingIterator<T>'s Element. Here we arrange for | ||
// the Collection itself to have an Element type that's deducible from | ||
// its subscript. Ideally we'd like to constrain this Element to be the same | ||
// as Collection.Iterator.Element (see below), but we have no way of | ||
// as Collection.Element (see below), but we have no way of | ||
// expressing it today. | ||
associatedtype _Element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we dump this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, seems we still need it, though I managed to ditch a handful of uses.
on Sat Apr 22 2017, Ben Cohen <notifications-AT-i.8713187.xyz> wrote:
No, seems we still need it, though I managed to ditch a handful of uses.
OK. You know Doug intends to make this change for us when he can
finally get it to work, yes? Might be more efficient to let him pursue
these.
|
Build comment file:Optimized (O) Regression (6)
Improvement (3)
No Changes (259)
Regression (1)
Improvement (1)
No Changes (266)
|
089f44e
to
a8651ea
Compare
@swift-ci Please test |
Build failed |
Build failed |
a8651ea
to
8869509
Compare
@swift-ci Please test |
Build failed |
Build failed |
Is |
@vmanot Conversely, using |
@timvermeulen right, that's my reasoning too. If you sat down with a blank screen but already had this feature in Swift, this is probably how you'd define it. In many cases both |
This is fantastic! |
8869509
to
16d9829
Compare
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please Test Source Compatibility |
@swift-ci Please test |
Build failed |
Build failed |
@swift-ci Please clean test linux platform |
on Mon Apr 24 2017, Vatsal Manot <notifications-AT-i.8713187.xyz> wrote:
Is `associatedtype` really necessary? Would not `typealias` better
reflect what we're trying to accomplish here, i.e. provide a
substitute for `Iterator.Element`?
It might, if typealiases in protocols worked for that purpose.
…--
-Dave
|
2a766d3
to
c6e4764
Compare
91ff29b
to
d5b59f9
Compare
@swift-ci please test |
Build failed |
Build failed |
964b8ad
to
ea54d07
Compare
@swift-ci please test |
Build failed |
Build failed |
75c0d64
to
dc9e3b7
Compare
dc9e3b7
to
59cca24
Compare
Folded into #8990 |
Adds an
associatedtype Element
toSequence
, then constrainsIterator.Element
to match it.