title: Update operations on a Scala Case Class
body: <p>I have two instantiated case classes of the same type. </p>
  
  <pre><code>case class Foo(x : Option[String], y : Option[String], z : Option[String])
  </code></pre>
  
  <p>Lets call the instantiated classes A and B. </p>
  
  <pre><code>val a = Foo(x=Some("foo"), y=Some("bar"), z=Some("baz"))
  val b = Foo(x=None, y=Some("etch"), z=None)
  </code></pre>
  
  <p>I'm wondering if its possible to update case class A with B in a single operation in a generic way.</p>
  
  <pre><code>val c = b *oper* a // produces Foo(x=Some("foo"), y=Some("etch"), z=Some("baz")) 
  </code></pre>
  
  <p>with parameters that are set as None ignored. Ideally the operation should also be generic so it can act on any type of case class.</p>
  
  <p>I have some intuition that it might be possible to do this with Scalaz by converting the class into a tuple/list first and converting back to a class after the operation is complete - perhaps using the ApplicativeBuilder? Am I thinking about this in the right way? Any ideas?</p>