title: How to cleanly deal with nested Future[Option[A]]
body: <p>I think this is probably a simple question, but I'm really struggling to get it right, I have the following functions:</p>
  <pre><code>def getInfo(identifier: Int): Future[Option[Info]]
  
  def deleteInfo(info: Info): Future[Bool]
  </code></pre>
  <p>I'm trying to implement the following:</p>
  <pre><code>def deleteInfoByID(identifier: Int): Future[Bool]
  </code></pre>
  <p>I'm wondering what the cleanest way to do this is?  I've tried a few variations on map and flatMap, but I can't seem to propagate the result of deleteInfo back to the top:</p>
  <pre><code>def deleteInfoByID(identifier: Int): Future[Bool]
      getInfo(identifier).map { infoOpt: Option[Info] =&gt;
        infoOpt.map { info =&gt;
          deleteInfoByID(identifier)
        }
      }
  </code></pre>