Forgive me if there's already a method for doing this--I just looked through the list of Option methods and couldn't find anything, but might have missed it. I'm just wondering if others find the following usage pattern common enough to add a (very simple) method to Option.
Basically:
var o: Option[A]
def f: A => B
var b: B
I frequently do something like:
o match {
case Some(a) => f(a)
case _ => b
}
I'd really like to just be able to say "o.applyOrElse(f, b)"
Opinions?
Thanks,
Ken