split
attempt to split the computation, giving access to the first result.
import arrow.core.*
fun main(args: Array<String>) {
//sampleStart
val result =
listOf("A", "B", "C").split()
//sampleEnd
println(result)
}
Content copied to clipboard
attempt to split the computation, giving access to the first result.
import arrow.core.split
fun main(args: Array<String>) {
//sampleStart
val result = sequenceOf("A", "B", "C").split()
//sampleEnd
result?.let { println("(${it.first.toList()}, ${it.second.toList()})") }
}
Content copied to clipboard