Transforming Seq[(A, Future[B])] into a Future[Map[A,B]] in Scala -
i'm looking clean way transform seq[(a, future[b])]
future[map[a,b]]
. there way this? in advance!
if you're allowed scalaz yes:
val original:seq[(string,future[int])] = seq("a" -> future.successful(1)) val transformed:future[map[string,int]] = original.tomap.sequenceu
Comments
Post a Comment