- {~~<~~ field = value; ... ~~>~~}

+ {| field = value; ... |}

For simplicity, the poly-record is immutable by itself. If you want to have mutable fields, you must use reference cells explicitly. The field access syntax provides a sugar to update the reference::

- let r = {~~<~~ x = 1; y = ref None ~~>~~} (* x and y are immutable, but y is a ref which is mutable *)

+ let r = {| x = 1; y = ref None |} (* x and y are immutable, but y is a ref which is mutable *)

let () = r..y <- Some 2 (* update the ref at y *)

let () = assert (!(r..y) = Some 2) (* Accessing the ref content is a bit lousy... *)

The type system can forget fields using coercion::

- let r = {~~<~~ x = 1; y = None ~~>~~}

+ let r = {| x = 1; y = None |}

let r' = (r :> < x : int > Polyrecord.t) (* forget about y *)