title: In Scala Akka futures, what is the difference between map and flatMap?
body: <p>in normal Scala map and flatMap are different in that flatMap will return a iterable of the data flattened out into a list.
  However in the Akka documentation, map and flatMap seem to do something different?</p>
  
  <p><a href="http://akka.io/docs/akka/1.1/scala/futures.html" rel="noreferrer">http://akka.io/docs/akka/1.1/scala/futures.html</a></p>
  
  <p>It says "Normally this works quite well as it means there is very little overhead to running a quick function. If there is a possibility of the function taking a non-trivial amount of time to process it might be better to have this done concurrently, and for that we use flatMap:"</p>
  
  <pre><code>val f1 = Future {
    "Hello" + "World"
  }
  
  val f2 = f1 flatMap {x =&gt;
    Future(x.length)
  }
  
  val result = f2.get()
  </code></pre>
  
  <p>Can someone please explain what is the difference between map and flatMap here in Akka futures?</p>