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

Stephen Celis stephen.celis at gmail.com
Wed Nov 15 15:49:59 CST 2017


> On Nov 15, 2017, at 4:15 PM, David Hart via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I’m very much against a term like compactMap because it uses the term compact which has no precedence in Swift’s Standard Library.

I don’t really care what the name ends up being (as long as it’s not “flatMap”), but you do bring up something worth addressing.

I imagine a majority of calls to this function are of the lines of “compactMap { $0 }”, so maybe it’s worth adding a helper/alias like “compact()”?

Stephen
https://www.pointfree.co
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171115/1d64fd4f/attachment.html>


More information about the swift-evolution mailing list