Skip to content

Change init's role in reduce-like functions: remove "neutral element" restriction and guarantee its use #53871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Standard library changes

* The `init` keyword for `reduce` and other reduction functions without guaranteed
associativity (`mapreduce`, `maximum`, `minimum`, `sum`, `prod`, `any`, and `all`)
now provides greater gaurantees on how its value is incorporated into the reduction:
now provides greater guarantees on how its value is incorporated into the reduction:
it is used exactly once as the left-most argument for all non-empty collections,
and it is no longer required to be a "neutral" operand for the reduction.
Previously, its semantics for non-empty collections was explicitly not specified, allowing
Expand Down