We're using scalaz validation trait in our project to validate HTTP parameters. The common case is taking few validated values and performing neccessary action only if all of them are valid, returning list of errors otherwise:
(pavam1Val.liftFailNel |@|
param2Val.liftFailNel |@|
param3Val.liftFailNel) {
getSomeResponse(_, _, _)
}
This works nice, until we have to use more than 8 parameters, because |@| operator constructs ApplicativeBuilder, which is limited to 8 arguments. Is there another way to perform such all-at-once validation, preferably keeping the code readable?