title: Sequential execution of functions using promises
body: <p>I want to sequentially execute some asynchronous functions based on an array.</p>
  
  <p>I thought this would do it :</p>
  
  <pre><code>var Promise = require("bluebird");
  Promise.cast([1,2,3]).reduce(function(_,i){
      console.log("Launching  " + i);
      return Promise.delay(Math.floor(Math.random()*1000)).then(function(){
          console.log("Executing  " + i);
      });
  },0);
  </code></pre>
  
  <p>but I get </p>
  
  <pre><code>Launching  1
  Launching  2
  Launching  3
  Executing  2
  Executing  1
  Executing  3
  </code></pre>
  
  <p>instead of the desired result which would be</p>
  
  <pre><code>Launching  1
  Executing  1
  Launching  2
  Executing  2
  Launching  3
  Executing  3
  </code></pre>
  
  <p>How can I ensure wholly sequential execution here ?</p>
  
  <p>Note that I know how to do that without promises, I'm only interested in full promises solutions.</p>