Shabinder Singh
List<Either<A,B>>
Either<List<A>,List<B>>
ValidaterNel<A,List<B>>
.sequence
.traverse {}
fun <A, B> Iterable<Either<A, B>>.toValidatedNel(): ValidatedNel<A, List<B>> { return traverse(semigroup = Semigroup.nonEmptyList()) { it.toValidatedNel() } }
simon.vergauwen
Either
Validated
raulraja
acc = Valid(emptyList())
f
Iterable
val res = f(a)
Invalid
acc
listOf(1).traverse { Invalid(it) }
acc = Valid(emptyList<B>())
val res = Invalid(1)
res
acc = Valid
A modern programming language that makes developers happier.