All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.neat.CollectionUtils.kt Maven / Gradle / Ivy

There is a newer version: 3.0.13
Show newest version
package neat

fun  Collection>.aggregate(value: T): Validity {
    val invalids = filterIsInstance>()
    return if (invalids.isEmpty()) {
        Valid(Unit)
    } else {
        Invalid(Unit, invalids.flatMap { it.reasons })
    }.map { value }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy