I do not think that there is some higher "smoothing" order for /. It seems that Validateion and ValidationNEL will be the best choice for this problem. However, here is a "dirty" solution for /, it will return first with an error. If you want to copy errors, validation is the way to go
val getMyList: \/[Throwable,List[\/[Throwable,Int]]] = //\/-(List(-\/(new RuntimeException("test")), \/-(1))) \/-(List(\/-(2), \/-(1))) val flatten = getMyList.fold(\/.left, _.foldLeft(\/.right[Throwable, List[Int]](List.empty[Int])) { case (\/-(list), \/-(i)) => \/-(list :+ i) case (\/-(list), -\/(err)) => -\/(err) case (-\/(err), _) => -\/(err) }) println(flatten)
source share