[swift-evolution] [Accepted and Focused Re-review] SE-0187: Introduce Sequence.filterMap(_:)

Tino Heth 2th at gmx.de
Wed Nov 15 16:05:42 CST 2017


> I’m happy that the rename was accepted. I’d like to support renaming it to filterMap because it uses two terms of art already pre-existing and understood by the Swift community
Odd… exactly that is the reason why I think filterMap is the worst choice:
Both are established terms of art, but one has a meaning that doesn’t fit to the operation.
Applying filter can remove elements, but it can never change types (I feel kind of silly to repeat this over and over, but so far, nobody took the time to falsify this).

So, I’d rather introduce a unburnt word than reuse an existing term that conveys a wrong message. Honestly, I’d consider „reduceMap“ less bad… but I can’t see any good reason to limit the choice to something that is already used in Swift — after all, we don’t have to pay for new names.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171115/754719ee/attachment.html>


More information about the swift-evolution mailing list