fseq doesnt wrap it

u.go
2015-12-18T04:17:49Z

gistfile1.scala

|
| Future.sequence(
| Option.empty[Seq[Int]].getOrElse(throw new RuntimeException("mA")).map(Future.apply(_))
| ) recover {
| case e: Throwable => throw new RuntimeException("mB")
| }
|
| // // Exiting paste mode, now interpreting.
|
| // java.lang.RuntimeException: mA
| // at $anonfun$2.apply(<console>:14)
| // at $anonfun$2.apply(<console>:14)
| // at scala.Option.getOrElse(Option.scala:121)
| // ... 37 elided
|
|
|
| // def sequence[A, M[X] <: TraversableOnce[X]](in: M[Future[A]])(implicit cbf: CanBuildFrom[M[Future[A]], A, M[A]], executor: ExecutionContext): Future[M[A]] = {
| // in.foldLeft(successful(cbf(in))) {
| // (fr, fa) => for (r <- fr; a <- fa) yield (r += a)
| // } map (_.result())
| // }