|
I have a |
Answered by
mpilquist
Nov 25, 2021
Replies: 1 comment 1 reply
|
Use the val p: Pipe[F, Byte, Unit] = ???
val q: Pipe[F, Byte, Nothing] = p.andThen(_.drain)That discarding has to be manual. To see why, consider this program: val s: Stream[Pure, Unit] = Stream(1, 2, 3).as(())
val s2: Stream[Pure, Int] = Stream(4, 5, 6)
val s3 = s ++ s2What's the type of |
1 reply
Answer selected by
Fristi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use the
.drainmethod onStreamto discard those units. For example:That discarding has to be manual. To see why, consider this program:
What's the type of
s3here? It's aStream[Pure, AnyVal]becauseAnyValis the least upper bound ofUnitandInt.