konform-kt / konform

Portable validations for Kotlin
https://www.konform.io
MIT License
637 stars 39 forks source link

Make Invalid non-generic #94

Closed dhoepelman closed 3 months ago

dhoepelman commented 3 months ago

ValidationResult was already made covariant in #56. This improves upon that by making Invalid invariant and extend ValidationResult<Nothing>, which is possible since Invalid does not hold the result, only the errors.

Additionally, make map an inline function which improves performance.