title: Is it possible to use a fixed constant instance of Failure as Try[B] for any B without casting?
body: <p>While thinking about my previous <a href="https://stackoverflow.com/questions/24399126/how-to-best-implement-first-success-in-scala-i-e-return-the-first-success-f">question</a>, I realized I ought to be able to write something like the following:</p>
  
  <pre><code>  val empty: Try[B, forall types B] = Failure(new RuntimeException("empty"))
    def firstSuccess[A, B](xs: Iterable[A], f: A =&gt; Try[B]): Try[B] = {
      xs.foldLeft(empty)((e, a) =&gt; e.recoverWith { case _ =&gt; f(a) })
    }
  </code></pre>
  
  <p>because a <code>Failure</code> is a valid <code>Try[B]</code> for any type <code>B</code>. Is there a way to achieve my "<code>B, forall types B</code>" in Scala?</p>