Skip to content
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 Reducible[NonEmptyVector].reduceMapA #3549

Merged
merged 2 commits into from
Aug 6, 2020

Conversation

takayahilton
Copy link
Contributor

No description provided.

@takayahilton takayahilton changed the title Enable breakout in Reducible[NonEmptyVector].reduceMapA can breakout Enable breakout in Reducible[NonEmptyVector].reduceMapA Aug 4, 2020
@@ -16,22 +16,6 @@ import org.scalacheck.Prop._

class ReducibleSuiteAdditional extends CatsSuite {

test("Reducible[NonEmptyList].reduceLeftM stack safety") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

duplicated test
test(s"Reducible[$name].reduceLeftM stack safety")

@takayahilton takayahilton force-pushed the fix-nonemptyc-reduceMapA branch 2 times, most recently from bed5e66 to 5ecb2c5 Compare August 4, 2020 07:12
@barambani
Copy link
Contributor

Nice test refactoring. It discovered another possible improvement. I think you can change also here

Eval.defer(fa.reduceRightTo(a => Eval.now(f(a))) { (a, b) =>
to

def reduceRightTo[A, B](fa: NonEmptyLazyList[A])(f: A => B)(g: (A, cats.Eval[B]) => cats.Eval[B]): cats.Eval[B] =
  Eval.defer(fa.reduceRightTo(a => Eval.later(f(a))) { (a, b) =>
    Eval.defer(g(a, b))
  })

@@ -484,7 +484,7 @@ sealed abstract private[data] class NonEmptyLazyListInstances extends NonEmptyLa
def reduceLeftTo[A, B](fa: NonEmptyLazyList[A])(f: A => B)(g: (B, A) => B): B = fa.reduceLeftTo(f)(g)

def reduceRightTo[A, B](fa: NonEmptyLazyList[A])(f: A => B)(g: (A, cats.Eval[B]) => cats.Eval[B]): cats.Eval[B] =
Eval.defer(fa.reduceRightTo(a => Eval.now(f(a))) { (a, b) =>
Eval.defer(fa.reduceRightTo(a => Eval.defer(f(a))) { (a, b) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Eval.defer(fa.reduceRightTo(a => Eval.defer(f(a))) { (a, b) =>
Eval.defer(fa.reduceRightTo(a => Eval.later(f(a))) { (a, b) =>

@takayahilton takayahilton force-pushed the fix-nonemptyc-reduceMapA branch 2 times, most recently from 5fb1f4a to 3df95de Compare August 4, 2020 15:18
@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2020

Codecov Report

Merging #3549 into master will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3549   +/-   ##
=======================================
  Coverage   91.30%   91.30%           
=======================================
  Files         386      386           
  Lines        8565     8565           
  Branches      255      248    -7     
=======================================
  Hits         7820     7820           
  Misses        745      745           

barambani
barambani previously approved these changes Aug 4, 2020
Copy link
Contributor

@barambani barambani left a comment

Choose a reason for hiding this comment

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

👍

barambani
barambani previously approved these changes Aug 5, 2020
.jvmopts Outdated
@@ -1,6 +1,6 @@
-Dfile.encoding=UTF8
-Xms1G
-Xmx5G
-Xmx6G
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this required by the JS build ? I'm asking as if that's the case we might have a look at how those builds go when this #3546 is in. We might not need this increase anymore. What do you think ?

Copy link
Contributor Author

@takayahilton takayahilton Aug 6, 2020

Choose a reason for hiding this comment

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

We might not need this increase anymore. What do you think ?

Indeed.
#3546 is already merged so remove this commit.

Copy link
Contributor

@barambani barambani left a comment

Choose a reason for hiding this comment

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

thanks a lot @takayahilton 👍

@barambani barambani merged commit e02445d into typelevel:master Aug 6, 2020
@takayahilton takayahilton deleted the fix-nonemptyc-reduceMapA branch August 7, 2020 04:20
@travisbrown travisbrown added this to the 2.2.0-RC3 milestone Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants