In Pull[F, O, R]
, R
is the return type. Pull
represents a computation that emits some values on the Stream (of type O) and returns a new thing (R). In order to convert a Pull to a Stream, R must be Unit. This is because an FS2 Stream does not have the ability to terminate with a return value.
See here for the conversation
Stream[F, O]
is monadic over O which are the output values emittedPull[F, O, R]
is monadic over R which is used for stateful transformations