-
-
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 NonEmptyMap#toNonEmptyList (issue #2346) #2535
Conversation
|
||
test("NonEmptyMap#toNonEmptyList is consistent with Map#toList and creating NonEmptyList from it"){ | ||
forAll{ nem: NonEmptyMap[String, Int] => | ||
nem.toNonEmptyList should ===(NonEmptyList.fromListUnsafe(nem.toSortedMap.toList)) |
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.
Unfortunately the toNonEmptyList
of NonEmptyMap
collides with toNonEmptyList
of Reducible
, so the nem.toNonEmptyList
here seems to return a NonEmptyList[Int]
instead of the NonEmptyList[(String, Int)]
that we want.
Maybe we should rename the method to toNel
instead? :)
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.
Worked, thanks a lot!
1daf808
to
66d8957
Compare
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.
LGTM, welcome to cats!
Codecov Report
@@ Coverage Diff @@
## master #2535 +/- ##
==========================================
+ Coverage 95.18% 95.19% +<.01%
==========================================
Files 360 360
Lines 6548 6549 +1
Branches 279 275 -4
==========================================
+ Hits 6233 6234 +1
Misses 315 315
Continue to review full report at Codecov.
|
Hello, this is my first pull request there so please go easy with me :)
As for #2346 started with small steps - implementing just first method. Frankly i have no idea if I placed this in proper place, no idea if my test is sufficient and no idea if the thing I implemented is performant and if my git message is sufficient. Would love any feedback from you. Then after initial feedback I will do my best to implement rest of the methods from that issue