@@ -1316,11 +1316,13 @@ object Observable {
1316
1316
}
1317
1317
}
1318
1318
1319
- @ inline def bufferTimed [Col [_]](duration : FiniteDuration )(implicit factory : Factory [A , Col [A ]]): Observable [Col [A ]] = bufferTimedMillis(
1319
+ @ inline def bufferTimed [Col [a] <: Iterable [a]](duration : FiniteDuration )(implicit factory : Factory [A , Col [A ]]): Observable [Col [A ]] =
1320
+ bufferTimedMillis(
1320
1321
duration.toMillis.toInt,
1321
1322
)
1322
1323
1323
- def bufferTimedMillis [Col [_]](duration : Int )(implicit factory : Factory [A , Col [A ]]): Observable [Col [A ]] = new Observable [Col [A ]] {
1324
+ def bufferTimedMillis [Col [a] <: Iterable [a]](duration : Int )(implicit factory : Factory [A , Col [A ]]): Observable [Col [A ]] =
1325
+ new Observable [Col [A ]] {
1324
1326
def unsafeSubscribe (sink : Observer [Col [A ]]): Cancelable = {
1325
1327
var isCancel = false
1326
1328
var builder = factory.newBuilder
@@ -1470,13 +1472,14 @@ object Observable {
1470
1472
def foldIO [B ](seed : B )(f : (B , A ) => B ): IO [B ] = scan(seed)(f).lastIO
1471
1473
def unsafeFoldFuture [B ](seed : B )(f : (B , A ) => B ): Future [B ] = scan(seed)(f).unsafeLastFuture()
1472
1474
1473
- def foldAllF [F [_]: Async , Col [_]](implicit factory : Factory [A , Col [A ]]): F [Col [A ]] = foldF(factory.newBuilder) { (buff, next) =>
1475
+ def foldAllF [F [_]: Async , Col [a] <: Iterable [a]](implicit factory : Factory [A , Col [A ]]): F [Col [A ]] = foldF(factory.newBuilder) {
1476
+ (buff, next) =>
1474
1477
buff += next
1475
1478
buff
1476
1479
}.map(_.result())
1477
- def foldAllIO [Col [_ ]](implicit factory : Factory [A , Col [A ]]): IO [Col [A ]] = foldAllF[IO , Col ]
1478
- def foldAll [Col [_ ]](implicit factory : Factory [A , Col [A ]]): Observable [Col [A ]] = Observable .fromEffect(foldAllIO[Col ])
1479
- def unsafeFoldToFuture [Col [_ ]]()(implicit factory : Factory [A , Col [A ]]): Future [Col [A ]] =
1480
+ def foldAllIO [Col [a] <: Iterable [a ]](implicit factory : Factory [A , Col [A ]]): IO [Col [A ]] = foldAllF[IO , Col ]
1481
+ def foldAll [Col [a] <: Iterable [a ]](implicit factory : Factory [A , Col [A ]]): Observable [Col [A ]] = Observable .fromEffect(foldAllIO[Col ])
1482
+ def unsafeFoldToFuture [Col [a] <: Iterable [a ]]()(implicit factory : Factory [A , Col [A ]]): Future [Col [A ]] =
1480
1483
foldAllIO[Col ].unsafeToFuture()(cats.effect.unsafe.IORuntime .global)
1481
1484
1482
1485
@ inline def prependEffect [F [_]: RunEffect ](value : F [A ]): Observable [A ] = concatEffect[F , A ](value, source)
0 commit comments