arrow-fx-coroutines / arrow.fx.coroutines.stream / append

append

fun <O, R> Pull<O, R>.append(post: () -> Pull<O, R>): Pull<O, R>fun <O> Stream<O>.append(s2: () -> Stream<O>): Stream<O>

Lazily appends s2 to the end of this stream.

import arrow.fx.coroutines.stream.*

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

Do you like Arrow?

Arrow Org
<