[swift-evolution] [Idea] Use optionals for non-optional parameters

David Sweeris davesweeris at mac.com
Mon Aug 15 18:08:31 CDT 2016

> On Aug 15, 2016, at 17:51, David Hart via swift-evolution <swift-evolution at swift.org> wrote:
> I prefer the much simpler and natural:
> let value = x.map { foo.bar(x: $0) }
> Is it me or has everybody been avoiding the map solution for some reason. It's the most elegant way to do such operations IMHO.
It doesn't help for functions with multiple parameters. At one point I'd made a "multimap" top-level function for iterating over multiple sequences... maybe something like that?

- Dave Sweeris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160815/0a89f3cf/attachment.html>

More information about the swift-evolution mailing list