Derek Berner
05/24/2019, 4:06 PMValidated to capture conversion errors before passing the results to the target function. Validated.applicative(Nel.semigroup<Throwable>()).map(
Validated.fromTry(Try { objectMapper.convertValue<A>(args[0]) })
.leftMap(NonEmptyList.Companion::just),
Validated.fromTry(Try { objectMapper.convertValue<B>(args[1]) })
.leftMap(NonEmptyList.Companion::just),
Validated.fromTry(Try { objectMapper.convertValue<C>(args[2]) })
.leftMap(NonEmptyList.Companion::just)
) { (a,b,c) -> f(a,b,c) }.fix()