mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-11 13:38:43 -05:00
19 lines
539 B
OCaml
19 lines
539 B
OCaml
(** {1 Backtrackable ref} *)
|
|
|
|
type 'a t
|
|
|
|
val create : ?copy:('a -> 'a) -> 'a -> 'a t
|
|
(** Create a backtrackable reference holding the given value initially.
|
|
@param copy if provided, will be used to copy the value when [push_level]
|
|
is called. *)
|
|
|
|
val set : 'a t -> 'a -> unit
|
|
(** Set the reference's current content *)
|
|
|
|
val get : 'a t -> 'a
|
|
(** Get the reference's current content *)
|
|
|
|
val update : 'a t -> ('a -> 'a) -> unit
|
|
(** Update the reference's current content *)
|
|
|
|
include Sidekick_sigs.BACKTRACKABLE1 with type 'a t := 'a t
|