Skip to content

Commit

Permalink
Update core/shared/src/main/scala/fs2/Stream.scala
Browse files Browse the repository at this point in the history
Co-authored-by: Arman Bilge <armanbilge@gmail.com>
  • Loading branch information
diesalbla and armanbilge committed Apr 2, 2023
1 parent b0152f0 commit bb294dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/shared/src/main/scala/fs2/Stream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1041,12 +1041,15 @@ final class Stream[+F[_], +O] private[fs2] (private[fs2] val underlying: Pull[F,
* Not as powerful as `observe` since not all pipes can be represented by `O => F[O2]`, but much faster.
* Alias for `evalMap(o => f(o).as(o))`.
*/
def evalTap[F2[x] >: F[x], O2](f: O => F2[O2])(implicit F: Functor[F2]): Stream[F2, O] = {
val _ = F
def evalTap[F2[x] >: F[x], O2](f: O => F2[O2]): Stream[F2, O] = {
def tapOut(o: O) = Pull.eval(f(o)) >> Pull.output1(o)
underlying.flatMapOutput(tapOut).streamNoScope
}

@deprecated("Use overload without functor", "3.7.0")
private[fs2] def evalTap[F2[x] >: F[x], O2](f: O => F2[O2], F: Functor[F2]): Stream[F2, O] =
evalTap(f)

/** Alias for `evalMapChunk(o => f(o).as(o))`.
*/
def evalTapChunk[F2[x] >: F[x]: Applicative, O2](f: O => F2[O2]): Stream[F2, O] =
Expand Down

0 comments on commit bb294dd

Please sign in to comment.