Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kailuowang committed May 3, 2019
1 parent ea2401f commit 64283ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions core/src/main/scala/cats/Apply.scala
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ trait Apply[F[_]] extends Functor[F] with InvariantSemigroupal[F] with ApplyArit
}

object Apply {

/**
* This semigroup uses a product operation to combine `F`s,
* if the `Apply[F].product` result in larger `F` e.g. when `F` is a `List`,
* accumulative usage of this instance, such as `combineAll`, will result in
* `F`s with exponentially increasing sizes.
*/
def semigroup[F[_], A](implicit f: Apply[F], sg: Semigroup[A]): Semigroup[F[A]] =
new ApplySemigroup[F, A](f, sg)
}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/test/scala/cats/tests/ApplicativeSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ApplicativeSuite extends CatsSuite {
val optionSemigroupFromApply = Apply.semigroup[Option, Int]
checkAll("Apply[Option].semigroup", SemigroupTests[Option[Int]](optionSemigroupFromApply).semigroup)
}

{
implicit val listwrapperApplicative = ListWrapper.applicative
implicit val listwrapperCoflatMap = Applicative.coflatMap[ListWrapper]
Expand Down

0 comments on commit 64283ce

Please sign in to comment.