[swift-evolution] ternary operator ?: suggestion

Craig Cruden ccruden at novafore.com
Tue Jan 19 12:18:32 CST 2016

That makes sense - I think I missed lost that with all the discussion (vaguely remember — but did not click).  

I would support that as a replacement to adding map to individual values.

> On 2016-01-20, at 1:03:16, Thorsten Seitz <tseitz42 at icloud.com> wrote:
> As I already said above I’m strongly against introducing a map function for basic types. This brings confusion to the notion of a partial function and to what a map function is and is not needed IMO.
> Just define the following global function:
> func match<T,U>(x: T, @noescape mapping: T -> U) -> U {
>     return mapping(x)
> }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160120/7a83a5a0/attachment.html>

More information about the swift-evolution mailing list