> On Jan 18, 2017, at 2:11 AM, Chris Eidhof via swift-evolution 
> <swift-evolution@swift.org> wrote:
> 
> I don't think we should replace the current `reduce` with the `inout` 
> version, also because the current reduce can be really useful as well (e.g. 
> when the return type is an Int). 
> 
> One downside of having a different name is that it'll be harder to discover 
> this version. If stressing the type-checker is the only problem, then maybe 
> we should improve the type-checker, instead of placing that burden on every 
> user of the language.

That's a nice sentiment, and there's certainly a lot of work we have yet to do 
on the type checker to make it generally better. Higher-order functions like 
`reduce` naturally chain into larger expressions, though, and having such a 
fundamental sequence operation drag down the type-checker every time you use it 
would be unfortunate if we can avoid overloading the name.

-Joe
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to