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

Kevin Ballard kevin at sb.org
Thu Nov 9 12:36:28 CST 2017


On Wed, Nov 8, 2017, at 09:29 PM, Paul Cantrell via swift-evolution wrote:> The problem in the Doodads example is that *the name flatMap is used
> to identify two distinct intents*: concatenating arrays and filtering
> nils. One can argue that those two operations are, in some lofty
> abstract sense, if you squint, two instances of some more general
> pattern — but I don’t think it’s fair to say that they represent the
> same *intent*. These separate intents deserve separate names.
They absolutely represent the same intent if you think of an optional as
a collection of zero or one elements.
-Kevin Ballard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171109/3abd1f21/attachment.html>


More information about the swift-evolution mailing list