itertools
itertools copied to clipboard
Extra iterator adaptors, iterator methods, free functions, and macros.
Introduces new zip alternatives. I was making an application that uses something like `zip_squash` and thought it could be implemented here. Examples might be forming pairs from 2 sets of...
They're just convenience method, but avoid having to dereference individual variants, and may mitigate missing the `Only` case.
This is very similar to std’s `Iterator::clone()` / `Cloned`, but works on more types, such as `CStr` / `CString`.
Closes #998 Implementations for the following methods: - duplicates_with_hasher - duplicates_by_with_hasher - unique_with_hasher - unique_by_with_hasher - all_unique_with_hasher - into_group_map_with_hasher - into_group_map_by_with_hasher - into_grouping_map_with_hasher - into_grouping_map_by_with_hasher - counts_with_hasher - counts_by_with_hasher
Most of the changes are to create a common abstraction that works for `permutations` and `{array_,}combinations`, much of it by @phimuemue. Completes a variant of #1001.
There is the `combinations()` and `tuple_combinations()` functions, I'm however missing the `tuple_permutations()` function. Is there a reason this couldn't exist? If not, I might even be open to implementing it...
It'd be really useful since generic tuples aren't out yet
Implementation of an iterator adaptor that generates all unique multiset permutations for the given iterator. Based on the algorithm presented in [this paper by Aaron Williams](https://doi.org/10.1137/1.9781611973068.107). Pro: It is substantially...
Like the title says, a `multizip` version of `zip_longest`. Here's how I imagine it working: ```rust Enum AtLeastOneOf { One(i32), Two(i32, i32), Three(i32, i32, i32), Four(i32, i32, i32, i32), N(...),...
All adaptors bounded by `Hash` would potentially benefit from a `with_hasher` variant that allowed supplying a faster `Hasher` (e.g., `ahash` or `fxhash`): - [duplicates](https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.duplicates) - [ ] `duplicates_with_hasher` - [duplicates_by](https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.duplicates_by)...