arrow-fx-coroutines / arrow.fx.coroutines.stream / prependTo
infix fun <A> Chunk<A>.prependTo(q: Queue<A>): Queue<A>
Prepends a chunk to the start of this chunk queue.
infix fun <O> Chunk<O>.prependTo(s: Stream<O>): Stream<O>
Prepends a Chunk onto the front of this stream.
import arrow.fx.coroutines.stream.*
//sampleStart
suspend fun main(): Unit =
(Chunk(-1, 0) prependTo Stream(1, 2, 3))
.toList().let(::println) // [-1, 0, 1, 2, 3]
//sampleEnd
infix fun <O> O.prependTo(s: Stream<O>): Stream<O>
Prepends a value onto the front of this stream.
import arrow.fx.coroutines.stream.*
//sampleStart
suspend fun main(): Unit =
(0 prependTo Stream(1, 2, 3))
.toList().let(::println) // [0, 1, 2, 3]
//sampleEnd
Do you like Arrow?
✖