Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun <L : Any, R : Any, R1 : Any, R2 : Any, ... , R22 : Any> validate(
- p1: Disjunction<L, R1>, p2: Disjunction<L, R2>, ... , p22: Disjunction<L, R22>,
- ifValid: (R1, R2, ... , R22) -> R
- ): Disjunction<List<L>, R> {
- val validation = Validation(p1, p2, ... , p22)
- return if (validation.hasFailures) {
- Disjunction.Left(validation.failures)
- } else {
- Disjunction.Right(ifValid(p1.get(), p2.get(), ... , p22.get()))
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement