Skip to content
New issue

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

Feature Request: Partition #1348

Closed
goughy000 opened this issue Jan 7, 2017 · 4 comments
Closed

Feature Request: Partition #1348

goughy000 opened this issue Jan 7, 2017 · 4 comments
Labels

Comments

@goughy000
Copy link

Would be good to have a new collections method for "partition"

Here's a description of how the method works in Ruby:
Returns two arrays, the first containing the elements of enum for which the block evaluates to true, the second containing the rest.

So it's a bit like a filter/reject combo.

If others are interested and I get time then I'll have a go at implementing but it won't be for a few weeks at least but I thought I would put the idea here in case someone else has time

@megawac
Copy link
Collaborator

megawac commented Jan 12, 2017

I'm not sure how I feel about adding partition to async but I would be open to a groupBy which could be used to fill almost the same need. The reason I'm not a big fan of supporting partition as its slightly too specific of a use case and for methods like this we have to add partition, partionLimit and partionSeries and the use case can be accomplished with a groupBy if we were to support it.

@goughy000
Copy link
Author

@megawac that makes perfect sense to me!

@hargasinski
Copy link
Collaborator

👍 for supporting groupBy.

hargasinski added a commit that referenced this issue Feb 27, 2017
* initial groupBy implementation
@hargasinski
Copy link
Collaborator

Fixed in #1364.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants