typelevel / typelevel/cats

RFC: Clean up NonEmptyMap interface

Open
#3,204 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
5.5k
Forks
1.2k
Avg merge
2d 10h
Merged PRs (30d)
5

Description

NonEmptyMap is a bit annoying to use due to some inconsistencies:

  • Although it has a .keys method like Map does, it doesn't have a corresponding .values method. There's something similar possible with .toNonEmptyList (from NonEmptyTraverse), but that's not very discoverable. I suggest we add def values: NonEmptyList[A] = this.toNonEmptyList.
  • It has a .toNel method that produces a NEL of pairs. This is inconsistent with .toList and (which is especially silly) with .toNonEmptyList. I suggest we rename toNel to pairs or something like that.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the NonEmptyMap interface and its keys, toNel, and toNonEmptyList methods, then inspect related API tests. Done means the proposed values method and pair-naming change have an agreed design and corresponding behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.