rust-itertools / itertools

Extra iterator adaptors, iterator methods, free functions, and macros.
https://docs.rs/itertools/
Apache License 2.0
2.64k stars 299 forks source link

Deprecate `tree_fold1` for `tree_reduce` #895

Closed Philippe-Cholet closed 4 months ago

Philippe-Cholet commented 4 months ago

I think tree_fold1 should have been deprecated for tree_reduce at the same time fold1 was deprecated for reduce.

With this deprecation, we will be able to remove tree_fold1 and fold1 at the same time and close that chapter once and for all.

@scottmcm Do you have an objection on this?

PS: I wish I had thought of this but no, thanks reddit.

scottmcm commented 4 months ago

Nope, no objections to me! Being consistent is good.

(Feel free to rename however you think is best. Could also consider reduce_tree or something for improved sorting, though it doesn't read quite as nicely so up to you.)

Philippe-Cholet commented 4 months ago

I'm okay with both. @jswrenn Feel free to merge or ask me to change the name.

jswrenn commented 4 months ago

Let's stick with tree_reduce. We don't have any other reduce* methods, so sorting doesn't matter too much for us. If the standard library decides to stabilize such a method, the libs team might want to revisit the name.