[swift-evolution] [Review] SE-0187: Introduce Sequence.filterMap(_:)

Tino Heth 2th at gmx.de
Wed Nov 8 03:51:14 CST 2017


> Would this attribute not be a form of deprecation?
So far, I only encountered deprecation in the context of legacy functionality that will be removed later — but after taking a look in the dictionary, I think the word is actually a good fit (even if there are no plans to remove flatMap).

> Yes, the rename has a fix-it, but still: to the extent that these things demand limited attention from the programmer, that attention should clearly be focused on the latter set of problems.
I think there are worse warnings now:
Xcode suggests that a freshly declared var might be problematic, because you just did not have the time to write the code that changes it, that a let might be problematic because you can’t write the code to use that constant at the same time… I think this one here is rather helpful, as it educates you about a real (albeit small) error that can easily be avoided.

Even if filterMap is accepted, imho such a warning would be needed:
How should the same people that use flatMap wrong magically learn not to use filterMap all the time?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171108/e606c777/attachment.html>


More information about the swift-evolution mailing list