-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 NonEmptyList#prependAll
#4267
Conversation
A couple of thoughts from my side. First of all, just to note: The second thing I'd like to call out is naming. On one hand, Scala library kinda reserves Therefore, IMO to keep Cats consistent with itself, it'd be more correct to name these methods |
Thanks for your comments!
Added that.
Added
Renamed that. Please review again. Looking forward to your feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core/src/main/scala/cats/data/NonEmptyList.scala
@saeltz looks good to me, thanks for your efforts! If you believe your PR is pretty much ready, would you mind pulling it out of the "Draft" state please? |
Thanks for addressing all the feedback! For anyone interested, here's a thread about the origin of the method naming that Sergey pointed out we should be consistent with: #1838 (comment) After reading that I'm a bit lost in the weeds but I promise I'll circle back soon :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a couple thoughts about tests :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all your work on this, I know the scope expanded quite a bit from your original PR. Very much appreciated!
NonEmptyList
was missing aprependAll
/++:
. This adds the method and the alias and tests. The implementation may not be most efficient.I also added an override for
concat
to append anOption
to aNonEmptyList
. I would have usedIterableOnce
as in the standard library for Scala 2.13 withSeq
. But I didn't know how to do that cross-version with Scala 2.12 andTraversableOnce
. Maybe I could useFoldable
? Any help appreciated.