Rename NonEmptySet to NonEmptySortedSet
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 5.5k
- Forks
- 1.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
Current implementation of the cats.data.NonEmptySet confuses, because it's not NonEmptySet, it's NonEmptySortedSet.
When it was introduced in cats 1.1.0 I was very excited about it, because there is a lot of use cases in my codebase for the NonEmptySet. But when I tried to use it I noticed that it uses Order typeclass and in general this new NonEmptySet was based on SortedSet, not simple Set. I understand, that there is a lot of use cases for NonEmptySortedSet, but NonEmptySortedSet is not NonEmptySet. For a lot of use cases, I don't need any ordering in my set, I just want to have a set with 1 or more elements.
Сurrent naming is misleading, especially for newcomers. I see no reason why NonEmptySortedSet should be named as NonEmptySet. So, I suggest to rename NonEmptySet to NonEmptySortedSet.
Because this change will break compatibility, I think the best way for renaming should look like this:
- Rename
NonEmptySortedSettoNonEmptySet. - Create an alias from
NonEmptySettoNonEmptySortedSet. - Mark this alias as deprecated.
- Remove this alias in the next major release.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the cats.data.NonEmptySet implementation and its usages in the repository. Review how the current type is exposed and used, then assess the proposed rename, deprecated alias, and removal in the next major release; done means the compatibility and release steps are defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala
- Domain
- data
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100