Is it possible to write a generalised orElse
method from Option
that takes a variable number of arguments? That is, instead of:
lazy val o1 = { println("foo"); None }
lazy val o2 = { println("bar"); Some("bar") }
lazy val o3 = { println("baz"); Some("baz") }
// ...
o1 orElse o2 orElse o3 // orElse ...
You could use:
orElse(o1, o2, o3) //, ...