[swift-evolution] Reduce with inout

Joe Groff jgroff at apple.com
Tue Jan 17 14:08:51 CST 2017


> On Jan 17, 2017, at 11:52 AM, Chris Eidhof <chris at eidhof.nl> wrote:
> 
> Any arguments against adding it? Otherwise I'll draft up a short proposal tomorrow.

I think it's the right thing for Swift. My main concern would be naming. If they're both named `reduce`, I suspect that will stress the type checker trying to pick an overload based on the context of the closure expression. We're stuck with `reduce` having the value-in-return-out formulation for Swift 3 compatibility; if that weren't the case, I'd argue we only need the `inout` form.

-Joe


More information about the swift-evolution mailing list