brson/stdx

Add itertools to stdx

LLBlumire opened this issue · 8 comments

Seems like a core part of what people commonly use for functionality with rusts iterators and I believe it meets all the criteria listed

brson commented

I actually just removed itertools! I agree it fits the criteria though.

The reason I removed it is because I was writing up examples and didn't see an obvious example for itertools that sold me on the crate being essential. And since I don't think I've ever used itertools myself it seemed like a good candidate to cut - keeping the list concise is important to me.

What's the thing you always reach to itertools for?

step, combinations, and cartesian_product are my most used.

my personal favorite are, in order, .sorted(), .unique(), and .group_by() (eventually lazy). These are all not-so-frequent operations, but still common enough in my opinion to justify the presence of itertools in stdx.

I use group_by frequently for splitting input streams, and I just used tuple_windows for an implementation of bigram language models. The combination of Itertools and Rayon feels like having superpowers!

.join() is really nice to have too

yeah, i too feel like itertools is a must have.
if you are programming in a more procedural, less functional style, though, you might never feel any need for them.

brson commented

Yeah, ok. It is quite popular and battle tested, and does fill some gaps.

See https://github.com/brson/stdx/blob/master/CONTRIBUTING.md for details on how to add a crate.

Use a simple example based one or some of the above mentioned features.

brson commented

Done