Hi Swift community,
The review of SE-0220: count(where:) begins now and runs through July 28, 2023.
This review is a refresh of a previously accepted proposal, which was subsequently expired after it was not shipped within a year of proposal acceptance. The process for proposal expiry is outlined here.
In the particular case of SE-0220, it was found that the introduction of a method Sequence.count(where:)
introduced type checking challenges because of ambiguity between it and Collection.count
.[1] In the time since the proposal expired, a number of improvements have been made to the type system have resolved this issue, and the language steering group feel the proposal can now be safely implemented in the standard library.
This review refreshes the SE-0220 proposal. The goal of the refresh review is not to re-litigate the original acceptance. Instead, the goals for a refresh review are 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.
Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to the review manager. When emailing the review manager directly, please keep the proposal link at the top of the message.
What goes into a review?
The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of Swift. When writing your review, here are some questions you might want to answer in your review:
- What is your evaluation of the proposal?
- Is the problem being addressed significant enough to warrant a change to Swift?
- Does this proposal fit well with the feel and direction of Swift?
- If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
- How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
More information about the Swift evolution process is available at
https://github.com/apple/swift-evolution/blob/main/process.md
Thank you,
Ben Cohen
Review Manager
In particular, when combined with the quirk that unapplied functions can drop their argument labels. So
["a"].count
could either be a call of thecount
property getter (an expression of typeInt
) or a reference to thecount(where:)
method (an expression of type((String) throws -> Bool) throws -> Int
). In some expressions involving array literals, this ambiguity led to a large impact on type checking time. ↩︎