Skip to content

Commit

Permalink
Enable breakout in Reducible[NonEmptyLazyList].reduceRightTo
Browse files Browse the repository at this point in the history
  • Loading branch information
takayahilton committed Aug 4, 2020
1 parent 5ecb2c5 commit 5fb1f4a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala-2.13+/cats/data/NonEmptyLazyList.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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.later(f(a))) { (a, b) =>
Eval.defer(g(a, b))
})

Expand Down

0 comments on commit 5fb1f4a

Please sign in to comment.