unweave
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)
}
Content copied to clipboard
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())
}
Content copied to clipboard