Closed loicdescotte closed 7 years ago
Combines several either values to give a global overview of errors without stopping at the first error.
val e1: Either<String, Int> = Either.Right(1) val e2: Either<String, Int> = Either.Left("Not a number") val e3: Either<String, Int> = Either.Right(3) val e4: Either<String, Int> = Either.Left("Negative value") val validation = Validation(e1, e2, e3, e4) assertTrue(validation.hasFailures) assertEquals(validation.failures, listOf("Not a number", "Negative value"))
It looks good, let me test it a little bit
Description
Combines several either values to give a global overview of errors without stopping at the first error.
Usage