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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -