Question : scala list of options to option of list
Answered by : z0san
if (myList.exists(_.isEmpty)) None else Some(myList.map(_.get))
Source : https://stackoverflow.com/questions/2569014/convert-a-list-of-options-to-an-option-of-list-using-scalaz | Last Update : Sun, 10 Apr 22
Question : scala list of options to option of list
Answered by : z0san
import scalaz.syntax.traverse._
import scalaz.std.list._
import scalaz.std.option._
myList.sequence
Source : https://stackoverflow.com/questions/2569014/convert-a-list-of-options-to-an-option-of-list-using-scalaz | Last Update : Sun, 10 Apr 22