From 20ece5d50689b24470abdb04c6929c5759db0f7e Mon Sep 17 00:00:00 2001 From: Dave Rostron Date: Wed, 26 Aug 2015 14:04:17 -0700 Subject: [PATCH] add combineAll alias for Foldable's fold --- core/src/main/scala/cats/Foldable.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/cats/Foldable.scala b/core/src/main/scala/cats/Foldable.scala index 34a6b7e547..08c5f810a4 100644 --- a/core/src/main/scala/cats/Foldable.scala +++ b/core/src/main/scala/cats/Foldable.scala @@ -64,6 +64,11 @@ import simulacrum.typeclass A.combine(acc, a) } + /** + * Alias for [[fold]]. + */ + def combineAll[A: Monoid](fa: F[A]): A = fold(fa) + /** * Fold implemented by mapping `A` values into `B` and then * combining them using the given `Monoid[B]` instance. @@ -211,7 +216,7 @@ trait CompositeFoldable[F[_], G[_]] extends Foldable[λ[α => F[G[α]]]] { implicit def G: Foldable[G] /** - * Left assocative fold on F[G[A]] using 'f' + * Left associative fold on F[G[A]] using 'f' */ def foldLeft[A, B](fga: F[G[A]], b: B)(f: (B, A) => B): B = F.foldLeft(fga, b)((b, a) => G.foldLeft(a, b)(f))