sig
type 'a ref
type ('a, 'b) reagent = ('a, 'b) t
val mk_ref : 'a -> 'a ref
val read : 'a ref -> (unit, 'a) reagent
val read_imm : 'a ref -> 'a
val cas : 'a ref -> 'a -> 'a -> (unit, unit) reagent
val cas_imm : 'a ref -> 'a -> 'a -> bool
val upd : 'a ref -> ('a -> 'b -> ('a * 'c) option) -> ('b, 'c) reagent
end