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

Add groupByNes #2282

Closed
kubukoz opened this issue Jun 5, 2018 · 3 comments
Closed

Add groupByNes #2282

kubukoz opened this issue Jun 5, 2018 · 3 comments

Comments

@kubukoz
Copy link
Member

kubukoz commented Jun 5, 2018

Sometimes it'd be nice to group a Set to non-empty Sets, like:

Set("a", "aa", "aaa", "bbb").groupByNes(_.length) <-> SortedMap(
  1 -> NonEmptySet.one("a"),
  2 -> NonEmptySet.one("aa"),
  3 -> NonEmptySet.of("aaa", "bbb")
)

I suggest that a SetSyntax trait is added with syntax for this, similar to the existing ListSyntax.
The way ListOps#groupByNel is implemented (list.toNel.groupBy(...))suggests that this could also involve having groupBy in NonEmptySet.

I'll gladly contribute that, given some pointers :)

@Obarros
Copy link
Contributor

Obarros commented Jun 9, 2018

@kubukoz I can take a look on this one.

@kubukoz
Copy link
Member Author

kubukoz commented Jun 9, 2018

Sure, go for it :)

@kubukoz
Copy link
Member Author

kubukoz commented Jun 14, 2018

Closed in #2285

@kubukoz kubukoz closed this as completed Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants