title: Copying fields in OCaml
body: <p>I have a very basic question regarding OCaml records. Suppose I have a record defined:</p>
  <pre><code>type r = {a: int; b: int; c: int}
  let x = {a=3; b=8; c=2}
  </code></pre>
  <p>Now, suppose I want to create a <em>new</em> record which has all fields equal to <code>x</code> but which has <code>c=4</code>. I could write:</p>
  <pre><code>let y = {a=3; b=8; c=4}
  </code></pre>
  <p>but this is annoying because there's not need to re-write <code>a=3</code> and <code>b=8</code>. I could also write:</p>
  <pre><code>let y = {a=x.a; b=x.b; c=4}
  </code></pre>
  <p>but this is still not good if the record has many fields. Is there any way of writing something like:</p>
  <pre><code>let y = {x with c=4}
  </code></pre>
  <p>or something of the sort?</p>