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

force

fun <A> force(f: suspend () -> Stream<A>): Stream<A>

Lifts an effect that generates a stream in to a stream. Alias for effect(f).flatMap(_).

import arrow.fx.coroutines.stream.*

//sampleEnd
suspend fun main(): Unit =
  Stream.force { Stream(1, 2, 3) }
    .toList()
    .let(::println) // [1, 2, 3]
//sampleStart

Do you like Arrow?

Arrow Org
<