unweave

fun <A, B> Iterable<A>.unweave(ffa: (A) -> Iterable<B>): List<B>(source)

Fair conjunction. Similarly to interleave

import arrow.core.*

fun main(args: Array<String>) {
//sampleStart
val result =
listOf(1,2,3).unweave { i -> listOf("$i, ${i + 1}") }
//sampleEnd
println(result)
}

fun <A, B> Sequence<A>.unweave(ffa: (A) -> Sequence<B>): Sequence<B>(source)

Fair conjunction. Similarly to interleave

import arrow.core.unweave

fun main(args: Array<String>) {
//sampleStart
val result = sequenceOf(1,2,3).unweave { i -> sequenceOf("$i, ${i + 1}") }
//sampleEnd
println(result.toList())
}