[swift-evolution] [Concurrency] async/await + actors

Chris Lattner clattner at nondot.org
Thu Aug 17 23:25:26 CDT 2017


> On Aug 17, 2017, at 7:28 PM, Yuta Koshizawa <koher at koherent.org> wrote:
> 
> I think we also need `reasync` like `rethrows`.
> 
>     extension Sequence {
>         func map<T>(_ transform: (Element) async throws -> T) reasync rethrows -> [T] { ... }
>     }
> 
>     let urls: [URL] = ...
>     let foos: [Foo] = await try urls.map { await try downloadFoo($0) }

That is mentioned in Potential Future Directions at the end.  It can certainly be done, but it comes with tradeoffs, and it seems better to settle on the design the basic proposal first.

-Chris




More information about the swift-evolution mailing list