AnyAsyncSequence

Can you expand on this?

AnySequence is extremely inefficient (for some avoidable and unavoidable reasons), so you should try not to use it for "information hiding" whenever possible. Doing the same with AsyncSequence probably isn't a good enough reason to add it (may even be a reason to not add it).

Long term, the intention is to expand opaque result types so that they can be used with where constraints. This would allow implementors to return a concrete sequence as an opaque sequence where Element == T, so prevent callers from relying on the specific type they return, allowing it to be changed later without a source break (or, in the case of a library built for distribution, an ABI break).

13 Likes