Dumb scala question: is there a nicer way to express this? def foo(opt: Option[List[Int]]) = opt.toList.flatMap{list => list.map{n => n*2}}
-
-
@avibryant@d6 +1 for opt.getOrElse(Nil).map(_ * 2). That'd be least surprising to me.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.