Skip to content

Fix copy-paste scaladoc variable names in NonEmptyVector, NonEmptySeq, NonEmptyChain#4824

Merged
satorg merged 1 commit intotypelevel:mainfrom
arnavsharma990:fix/scaladoc-copy-paste-nel-variable-names
Feb 21, 2026
Merged

Fix copy-paste scaladoc variable names in NonEmptyVector, NonEmptySeq, NonEmptyChain#4824
satorg merged 1 commit intotypelevel:mainfrom
arnavsharma990:fix/scaladoc-copy-paste-nel-variable-names

Conversation

@arnavsharma990
Copy link

@arnavsharma990 arnavsharma990 commented Feb 20, 2026

Problem

Scaladoc examples in groupByNem and grouped inside NonEmptyVector, NonEmptySeq, and NonEmptyChain were copied from NonEmptyList and never had their variable names updated. All three used nel (short for NonEmptyList) instead of a name matching the actual type.

Changes

Renamed the scaladoc example variable in each affected file:

File Before After
NonEmptyVector.scala val nel = NonEmptyVector.of(...) val nev = NonEmptyVector.of(...)
NonEmptySeq.scala val nel = NonEmptySeq.of(...) val neSeq = NonEmptySeq.of(...)
NonEmptyChain.scala val nel = NonEmptyChain.of(...) val nec = NonEmptyChain.of(...)

…, NonEmptyChain

Scaladoc examples in groupByNem and grouped were copied from NonEmptyList
and still used  as the variable name inside NonEmptyVector, NonEmptySeq
and NonEmptyChain. Renamed to the conventionally expected identifiers:
  - NonEmptyVector: nel -> nev
  - NonEmptySeq:    nel -> neSeq
  - NonEmptyChain:  nel -> nec

No functional change.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Scaladoc REPL examples in Cats’ non-empty collection types to use variable names that match the type being demonstrated (avoiding leftover nel from NonEmptyList copy/paste).

Changes:

  • Rename Scaladoc example variable from nel to nev in NonEmptyVector docs for groupByNem and grouped.
  • Rename Scaladoc example variable from nel to neSeq in NonEmptySeq docs for groupByNem and grouped.
  • Rename Scaladoc example variable from nel to nec in NonEmptyChain docs for grouped.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
core/src/main/scala/cats/data/NonEmptyVector.scala Fixes Scaladoc example variable names to align with NonEmptyVector (nev).
core/src/main/scala/cats/data/NonEmptySeq.scala Fixes Scaladoc example variable names to align with NonEmptySeq (neSeq).
core/src/main/scala/cats/data/NonEmptyChain.scala Fixes Scaladoc example variable names to align with NonEmptyChain (nec).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@satorg satorg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@satorg satorg merged commit 685abf9 into typelevel:main Feb 21, 2026
19 of 20 checks passed
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

Successfully merging this pull request may close these issues.

3 participants