@@ -1040,17 +1040,18 @@ final class Stream[+F[_], +O] private[fs2] (private[fs2] val underlying: Pull[F,
10401040 underlying.flatMapOutput(evalOut).streamNoScope
10411041 }
10421042
1043- /** Like `evalMap`, but operates on chunks for performance. This means this operator
1044- * is not lazy on every single element, rather on the chunks .
1043+ /** Like `evalMap`, but operates on chunks for performance. Evaluates `f` for all elements
1044+ * within a chunk using the Applicative instance, which allows parallel evaluation if supported by `F` .
10451045 *
1046- * For instance, `evalMap` would only print twice in the follow example (note the `take(2)`):
1046+ * This operator is not lazy on individual elements, only on chunks. For instance, `evalMap` would
1047+ * only print twice in the following example (note the `take(2)`):
10471048 * @example {{{
10481049 * scala> import cats.effect.SyncIO
10491050 * scala> Stream(1,2,3,4).evalMap(i => SyncIO(println(i))).take(2).compile.drain.unsafeRunSync()
10501051 * res0: Unit = ()
10511052 * }}}
10521053 *
1053- * But with `evalMapChunk`, it will print 4 times:
1054+ * But with `evalMapChunk`, it will print 4 times (entire first chunk is processed) :
10541055 * @example {{{
10551056 * scala> Stream(1,2,3,4).evalMapChunk(i => SyncIO(println(i))).take(2).compile.drain.unsafeRunSync()
10561057 * res0: Unit = ()
@@ -1233,6 +1234,8 @@ final class Stream[+F[_], +O] private[fs2] (private[fs2] val underlying: Pull[F,
12331234 /** Like `filter`, but the predicate `f` depends on the previously emitted and
12341235 * current elements.
12351236 *
1237+ * The first element is always emitted (no previous element to compare).
1238+ *
12361239 * @example {{{
12371240 * scala> Stream(1, 9, 5, 6, 7, 8, 9, 10).filterWithPrevious((previous, current) => previous < current).toList
12381241 * res0: List[Int] = List(1, 9, 10)
0 commit comments