itertools icon indicating copy to clipboard operation
itertools copied to clipboard

Extra iterator adaptors, iterator methods, free functions, and macros.

Results 211 itertools issues
Sort by recently updated
recently updated
newest added

Not sure if this is needed, but I thought since it's deprecated it's best to move away from it.

This is a first draft resulting from the discussion in #611. Closes #611.

It would be neat to have a way of iterating over all possible partitions of some vector. Example usages: `all_partitions(&vec![7,8,9])` should iterate over ``` [[7,8,9]] [[7,8],[9]] [[7,9],[8]] [[7],[8,9]] [[7],[8],[9]] ```...

Basically an alternative to https://github.com/rust-lang/rust/issues/68995 implemented in itertools. Approximate usage is described in the original issue.

The `free::zip` function had a short explanation. I went ahead and fleshed it out a bit. I also placed the code example under the `## Example` subheading.

Improved the description of the function and added example.

I have found it useful to have a map that is able to hold a cached value, which can be used during the iteration. The name `fold_map` comes to mind...

This commit is quite a mouth full and I'm can understand if you want me to split this into smaller chunks. Let me start explain it commit by commit. First...

* Added more methods for accessing the left and right variants. * Added methods for inserting left and right values (using unsafe code). * Improved some grammar.

It would be nice to have an iterator wrapper that repeats the final element of underlying iterator. Examples: - empty: `[]` -> `[]` - single element: `[1]` -> `[1, 1,...