Ref.And_value
type t =
| T : 'a ref * 'a -> t
val set : t -> unit
set (T (r, x)) is equivalent to r := x.
set (T (r, x))
r := x
val sets : t list -> unit
sets ts = List.iter ts ~f:set
val snapshot : t -> t
snapshot (T (r, _)) returns T (r, !r).
snapshot (T (r, _))
T (r, !r)