File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
tests/src/test/scala/cats/tests Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,13 @@ trait Apply[F[_]] extends Functor[F] with InvariantSemigroupal[F] with ApplyArit
216
216
}
217
217
218
218
object Apply {
219
+
220
+ /**
221
+ * This semigroup uses a product operation to combine `F`s.
222
+ * If the `Apply[F].product` results in larger `F` (i.e. when `F` is a `List`),
223
+ * accumulative usage of this instance, such as `combineAll`, will result in
224
+ * `F`s with exponentially increasing sizes.
225
+ */
219
226
def semigroup [F [_], A ](implicit f : Apply [F ], sg : Semigroup [A ]): Semigroup [F [A ]] =
220
227
new ApplySemigroup [F , A ](f, sg)
221
228
}
Original file line number Diff line number Diff line change @@ -46,10 +46,10 @@ class ApplicativeSuite extends CatsSuite {
46
46
}
47
47
48
48
{
49
- implicit val listwrapperApply = ListWrapper .applyInstance
50
- implicit val listwrapperSemigroup = Apply .semigroup[ListWrapper , Int ]
51
- checkAll(" Apply[ListWrapper].semigroup" , SemigroupTests [ListWrapper [Int ]].semigroup)
49
+ val optionSemigroupFromApply = Apply .semigroup[Option , Int ]
50
+ checkAll(" Apply[Option].semigroup" , SemigroupTests [Option [Int ]](optionSemigroupFromApply).semigroup)
52
51
}
52
+
53
53
{
54
54
implicit val listwrapperApplicative = ListWrapper .applicative
55
55
implicit val listwrapperCoflatMap = Applicative .coflatMap[ListWrapper ]
You can’t perform that action at this time.
0 commit comments