arrow-fx-coroutines / arrow.fx.coroutines.stream / Stream / dropThrough

dropThrough

fun dropThrough(p: (O) -> Boolean): Stream<O>

Like dropWhile, but drops the first value which tests false.

import arrow.fx.coroutines.stream.*

//sampleStart
suspend fun main(): Unit =
  Stream.range(0..10)
    .dropThrough { it != 4 }
    .toList()
    .let(::println) // [5, 6, 7, 8, 9, 10]
//sampleEnd

Do you like Arrow?

Arrow Org
<