-
-
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
Enable breakout in functions reduceRightToOption and reduceRightTo. #3498
Enable breakout in functions reduceRightToOption and reduceRightTo. #3498
Conversation
ref: #3015 |
Codecov Report
@@ Coverage Diff @@
## master #3498 +/- ##
=======================================
Coverage 91.75% 91.75%
=======================================
Files 383 383
Lines 8406 8409 +3
Branches 232 217 -15
=======================================
+ Hits 7713 7716 +3
Misses 693 693 |
3811c48
to
90fde63
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.
What do you think about adding a couple of tests to make sure that this is enforced in future changes ? On the line of your examples
test("test") {
val notAllEven = NonEmptyList.of(2, 4, 6, 9, 10, 12, 14)
val out = mutable.ListBuffer[Int]()
notAllEven.reduceMapA { a => out += a; if (a % 2 == 0) Some(a) else None }
out.toList should ===(List(2, 4, 6, 9))
}
May be also a stack safety check ? Thanks.
@@ -2,7 +2,6 @@ package cats | |||
package data | |||
|
|||
import NonEmptyChainImpl.create | |||
import cats.{Order, Semigroup} |
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.
Nice cleanup here and below, thanks.
0a5996a
to
fba36f9
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.
thanks 👍
now
After applying this PR