Is it possible to transform a List[F[G[A]]]
into F[G[List[A]]]
nicely?
I can do this in Scalaz the following way:
val x: List[Future[Option[Int]]] = ???
val transformed: Future[Option[List[Int]]] = x.sequenceU.map(_.sequenceU)
I'm just wondering if there's a nicer way to do this rather than .sequenceU.map(_.sequenceU)
Perhaps using a monad transformer? I did attempt this, without much luck.