Skip to content

Commit

Permalink
add back mistakenly removed overrides
Browse files Browse the repository at this point in the history
These performance overrides were mistakenly removed by #2941
  • Loading branch information
kailuowang committed Jul 20, 2019
1 parent 7e94169 commit 68a7aed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/src/main/scala/cats/data/NonEmptyChain.scala
Expand Up @@ -428,6 +428,14 @@ sealed abstract private[data] class NonEmptyChainInstances extends NonEmptyChain
}
.value

override def size[A](fa: NonEmptyChain[A]): Long = fa.length

override def reduceLeft[A](fa: NonEmptyChain[A])(f: (A, A) => A): A =
fa.reduceLeft(f)

override def reduce[A](fa: NonEmptyChain[A])(implicit A: Semigroup[A]): A =
fa.reduce

def reduceLeftTo[A, B](fa: NonEmptyChain[A])(f: A => B)(g: (B, A) => B): B = fa.reduceLeftTo(f)(g)

def reduceRightTo[A, B](fa: NonEmptyChain[A])(f: A => B)(g: (A, cats.Eval[B]) => cats.Eval[B]): cats.Eval[B] =
Expand Down

0 comments on commit 68a7aed

Please sign in to comment.