Base.RefSourceModule for the type ref, mutable indirection cells r containing a value of type 'a, accessed with !r and set by r := a.
set_temporarily t a ~f sets t to a, calls f (), and then restores t to its value prior to set_temporarily being called, whether f returns or raises.
sets_temporarily [ ...; T (ti, ai); ... ] ~f sets each ti to ai, calls f (), and then restores all ti to their value prior to sets_temporarily being called, whether f returns or raises.