[Accepted with Modification] SE-0298: Async/Await: Sequences

The review of SE-0298: Async/Await: Sequences concluded yesterday.

Feedback was overwhelmingly positive, with most of the discussion (and concerns) focused on the cancel() requirement of AsyncSequence. In light of this feedback, the proposal authors have determined at cancel() should be removed. The Core Team has accepted this proposal with the following modifications:

  • The cancel() requirement has been removed from AsyncSequence, per discussion feedback.
  • The first() method has been removed. It's non-asynchronous counterpart is a property, but at present properties cannot be async. With async properties under active discussion, the Core Team felt that it would be better to let that discussion settle first (which may result in first becoming an async property) than risk having to change this declaration from a method to a function soon.
  • The makeAsyncIterator has been marked as __consuming. This is mostly an implementation detail, but is in line with Sequence.makeIterator.

The accepted proposal has been modified accordingly. Thank you to the proposal authors and to everyone who participated in the review!

Doug Gregor
Review Manager

40 Likes

Sorry to bump this, but I just noticed that many of the AsyncSequence to AsyncSequence functions are both async rethrows and itself returns Async*Sequence, including flatMap, drop, dropFirst, prefix(while:), and prefix(filter:). Is this a typo, since the section outline explicitly that these functions defer any computation to the resulting AsyncSequence and are themselves not async?

Terms of Service

Privacy Policy

Cookie Policy