arrow-fx-coroutines / arrow.fx.coroutines.stream / Stream / take
Emits the first n elements of this stream. Alias for take.
Emits the first n elements of this stream.
import arrow.fx.coroutines.stream.*
//sampleStart
suspend fun main(): Unit =
Stream.range(0..1000)
.take(5)
.toList()
.let(::println) // [0, 1, 2, 3, 4]
//sampleEnd
Do you like Arrow?
✖