Module Tjr_lib_core.Tjr_store

A functional store.

Because of set and get, this module should probably not be opened.

module Internal : sig ... end

Internal implementation

module With_sig : sig ... end
include With_sig
type fstore
type 'a ref_
val empty_fstore : ?⁠allow_reset:bool -> unit -> fstore

allow_reset means that a ref can be set more than once (including the initialization

val set_read_only : fstore -> fstore

if this flag is set, then set will throw an exception

val mk_ref : 'a -> fstore -> 'a ref_ * fstore
val set : 'a ref_ -> 'a -> fstore -> fstore
val get : 'a ref_ -> fstore -> 'a
val mk_uref : name:string -> fstore -> 'a ref_ * fstore

an uninitialized reference (no initial value)

val uref_initialized : 'a ref_ -> fstore -> bool
val urefs_status : fstore -> (string * bool) list
val urefs_initialized : print:bool -> fstore -> bool
module Make_imperative_fstore : functor (S : sig ... end) -> sig ... end

An imperative version; the functional store can be accessed via a normal ocaml reference