We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I propose a small, trivial addition to the slices package.
func Reduce[S ~[]E, E any, T any](s S, f func(T, E) T, init T) T { for _, v := range s { init = f(init, v) } return init }
I often use similar func in other languages (js, PHP) and I think it'll be useful for GO as well.
I'm happy to contribute a PR with tests if this is a good idea.
The text was updated successfully, but these errors were encountered:
Duplicate of #61898
Sorry, something went wrong.
No branches or pull requests
I propose a small, trivial addition to the slices package.
I often use similar func in other languages (js, PHP) and I think it'll be useful for GO as well.
I'm happy to contribute a PR with tests if this is a good idea.
The text was updated successfully, but these errors were encountered: