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

Yuta Koshizawa koher at koherent.org
Thu Aug 17 21:28:54 CDT 2017


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) }

--
Yuta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170818/206bfe5e/attachment.html>


More information about the swift-evolution mailing list