Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a compact() shorthand for Sequence.compactMap (SE-0187) #17044

Closed
wants to merge 1 commit into from
Closed

Add a compact() shorthand for Sequence.compactMap (SE-0187) #17044

wants to merge 1 commit into from

Conversation

zoul
Copy link

@zoul zoul commented Jun 7, 2018

The accepted and implemented SE-0187 says “…we will add Sequence.compact() when it is possible to do so.” It seems to be possible now, and the shorter syntax for a common operation (filtering nils out of a collection) is a nice addition.

The accepted and implemented SE-0187 says “…we will add Sequence.compact() when
it is possible to do so.” It seems to be possible now, and the shorter syntax
for a common operation (filtering `nil`s out of a collection) is a nice
addition.
@zoul
Copy link
Author

zoul commented Jun 7, 2018

Hm, according to this Evolution thread we would better wait for the real deal (extension Sequence where Element : Optional), since going with the temporary generic solution now would cause problems with ABI stability later.

@zoul zoul closed this Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant