title: How to create an optional instance of a case class?
body: <p>Suppose I've got <code>case class A(os: Option[String], ox: Option[Int], oy: Option[Int])</code> and need a function <code>(Option[String], Option[Int], Option[Int]) =&gt; Option[A]</code> to return <code>None</code> if all the arguments are <code>None</code> and <code>Some[A]</code> otherwise: e.g.</p>
  
  <pre><code>def foo(os: Option[String], ox: Option[Int], oy: Option[Int]): Option[A] = ???
  
  foo(Some("abc"), Some(1), Some(2)) // Some(A(Some("abc"), Some(1), Some(2))
  foo(Some("abc"), None, None)       // Some(A(Some("abc"), None, None))
  foo(None, None, None)              // None
  </code></pre>
  
  <p>How would you write <code>foo</code> ?</p>