cats
cats copied to clipboard
Add missing methods to NE collections and syntax
The initial discussion is here.
The following methods are added:
-
NonEmptyList
:-
prependList
-
-
ListOps
:-
concatNel
-
-
VectorOps
:-
concatNev
-
-
SeqOps
:-
concatNeSeq
-
groupByNeSeq
(similar toListOps#groupByNel
andVectorOps#groupByNev
) -
groupByNeSeqA
(similar toListOps#groupByNelA
andVectorOps#groupByNevA
) -
scanLeftNeSeq
(similar toListOps#scanLeftNel
andVectorOps#scanLeftNev
) -
scanRightNeSeq
(similar toListOps#scanRightNel
andVectorOps#scanRightNev
)
-
All the new methods are covered by appropriate tests.
Note: this PR is based on #3931. Since by this moment the former PR has not been merged yet, these new methods show up here too:
-
VectorOps
:-
groupByNev
-
groupByNevA
-
scanLeftNev
-
scanRightNev
-
Technically this PR supersedes the previous one therefore if all changes from both PRs are accepted, then we can just go ahead and merge this PR only and close the other.
I appreciate the time you have taken to do this. I find it hard to review code that just adds ad-hoc methods to enrich standard types. It's difficult to know that we are being consistent or that we aren't missing a more general concept that should properly be added to a typeclass (which is the main focus of cats).