Add @ArrayBuilder to the standard library

Started a discussion in the swift-collections subforum about whether or not folks think an @ArrayBuilder would be a good for the collections package: @ArrayBuilder in swift-collections?

I think there is at least one language improvement that we should make regardless:

And potentially another, pending investigation on the source compatibility side:

The result builder inferred generics change is new language functionality so probably requires an evolution proposal. Since I have an implementation for that one, I will submit a proposal for it.

I’ll also investigate what it would take to support let someArray = [String] { ... }. It’s possible that’s “just a bug fix” that doesn’t require an evolution proposal. If we decide it does require an evolution proposal, we could bundle them together.

2 Likes