Hi there. I’m using `ValidatedNel` to validate and...
# arrow
j
Hi there. I’m using
ValidatedNel
to validate and accumulate potential errors when converting objects from one domain to another. Thing is that these objects (deserialized from rest endpoints) have like 20+ fields, which requires me to write custom large
.zip
extensions, since the library provides arity only up to 10. This is not only inconvenient, but also simply smelly. Is there any better way (or some kind of best practice) to perform validations/conversions on such large number of parameters?
s
Hey @Jakub Gwóźdź, Sadly there is no way to conveniently defining so much parameters in Kotlin 😞 You can easily compose multiple
zip
with each other using
Tuple
. Here is a Slack thread that explains the solution, hope that helps ☺️ https://kotlinlang.slack.com/archives/C5UPMM0A0/p1663913017330369