Let\'s say I have two optional Ints (both can be Some or None):
val one : Option[Int] = Some(1) val two : Option[Int] = Some(2)
My question is
You could try this:
for( x <- one.orElse(Some(0)); y <- two.orElse(Some(0))) yield x+y