split

fun <A> Iterable<A>.split(): <ERROR CLASS><List<A>, A>?

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)
}

fun <A> <ERROR CLASS><A>.split(): <ERROR CLASS><<ERROR CLASS><A>, A>?

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()})") }
}