Просто некоторые дженерики не были выведены. Попробуйте указать их явно
type AllErrorsOr[A] = Validated[List[String], A]
def bothInvalid: AllErrorsOr[(Int, Int)] = {
Semigroupal[AllErrorsOr].product[Int, Int](
Validated.invalid(List("Error 1")),
Validated.invalid(List("Error 2"))
)
}
def bothInvalidTuple: AllErrorsOr[(Int, Int)] = {
Semigroupal.tuple2[AllErrorsOr, Int, Int](
Validated.invalid(List("Error 1")),
Validated.invalid(List("Error 2"))
)
}
def bothValid: AllErrorsOr[(Int, Int)] = {
Semigroupal[AllErrorsOr].product[Int, Int](
Validated.valid(10),
Validated.valid(20)
)
}
def bothValidTuple: AllErrorsOr[(Int, Int)] = {
Semigroupal.tuple2[AllErrorsOr, Int, Int](
Validated.valid(10),
Validated.valid(20)
)
}