[Accepted (again)] SE-0220: count(where:)

Hi everyone.

The review of SE-0220 ran from July 18th to the 28th. This was a refresh review after the previous proposal had expired. The goal for the refresh review was to check, in the time since the previous acceptance, that nothing has significantly changed in the language or ecosystem that now suggests the acceptance is no longer valid. No concerns were raised, and the proposal has been accepted.

As always, thanks to the community for participating in the evolution process.

Ben Cohen
Review Manager

36 Likes

This still looks like its under active review on Swift.org - Swift Evolution ?

@Ben_Cohen is there any further progress? count(where:) is already merged to main brunch and it seems like this func can be introduced in the nearest Swift release.

At the same time count(of:) proposed by @Soroush_Khanlou also make sense and should be shipped with count(where:). While count(where:) is useful on its own, I think it is not a good idea for making one more evolution process for count(of:) separately.

The proposal is accepted and the implementation has landed; count(of:)—I'm not actually sure to what this refers, as it has been variously pitched—is not a part of the proposal. All API additions to the standard library require Evolution review.

count(of:) was suggested in https://github.com/apple/swift/pull/16099
It solves the same problem but when Element is Equatable – count(of: 5) instead of count(where: { $0 == 5 })

Yes, but not released yet. I agree about the rule All API additions to the standard library require Evolution review. At the same time it took almost 5 years for count(where:) be added to standard library.
count(of:) is like a kind of overload for Equatable elements. Is there any meaningful reasons for a separated pitch? I don't insists on adding count(of:), it is only a reasonable suggestion from my point of view.

No such overload is part of the approved proposal. All API additions to the standard library require Evolution review. Feel free to discuss, then pitch this addition in the Evolution section of this forum!

1 Like

No, I don't think this proposal has been re-implemented yet.

I stand corrected then!