module type S =Signature of a dashtbl.sig
..end
include Datatype.S
type
key
type
data
val create : int -> t
val add : t -> string -> key -> State.t list -> data -> unit
key, data
in the table.
The dependencies are the states required for computing the binding.
More precisely, a binding is a triple key --> state --> data
and add
k l d
adds as many bindings as the length of the list, but all these
bindings correspond to the very same state.
Be aware that add k [ s1; s2 ] v
is NOT equivalent to add k [ s1
] v; add k [ s2 ] v
.
k, v
in the
table which requires both s1
and s2
to be computed. If you clear
the dependencies of s1
, this binding is removed from the table.k, v
in the table. The first one is computed by using s1
while the second
one (containing the same value) is computed by using s2
. If you clear
the dependencies of s1
, only the first binding is removed from the
table, but the second one is still present.val replace : reset:bool ->
t -> string -> key -> State.t list -> data -> unit
add
but replace the existing bindings if any (same
difference that Hashtbl.replace
wrt Hashtbl.add
.
If reset
to true
, all the dependencies of old bindings are cleared.
It is always safe to put reset
to true
, but it may be unsafe to
put it to false
.
reset
eraval memo : reset:bool ->
(data list -> data) ->
t -> string -> key -> State.t list -> data
memo ~reset f s k l
replaces the bindings in the table by a new one
computed by applying f
. The argument of f
is the list of existing
bindings (the empty list if there is no binding). If reset
is
true
, all the dependencies of old bindings are cleared. It is always
safe to put reset
to true
, but it may be unsafe to put it to
false
.val clear : reset:bool -> t -> unit
reset
is true
, all the dependencies of the table are also
cleared.
It is always safe to put reset
to true
, but it may be unsafe to
put it to false
.val remove : reset:bool -> t -> key -> State.t -> unit
reset
is true
, clear all athe dependencies of the removed
binding.
It is always safe to put reset
to true
, but it may be unsafe to
put it to false
.val remove_all : reset:bool -> t -> key -> unit
reset
is true
, clear all the dependencies of each removed
binding.
It is always safe to put reset
to true
, but it may be unsafe to
put it to false
.val filter : reset:bool ->
(key -> State.t option -> data -> bool) ->
t -> key -> unit
reset
is true
, clear all the dependencies of each removed
binding.
It is always safe to put reset
to true
, but it may be unsafe to
put it to false
.val mem : t -> key -> bool
true
if there is a binding with the given key.val is_local : t -> State.t -> bool
true
if the state corresponds to a binding of the dashtbl.val find : ?who:State.t list ->
t -> key -> State.t -> data * State.t
who
is set, automatically adds dependency from the found state
to each of states of who
.Not_found
if there is no such bindingval find_key : t -> State.t -> (key * State.t) list
val find_data : ?who:State.t list -> t -> key -> State.t -> data
who
is set, automatically adds dependency from the state
corresponding to the given data to each of states of who
.Not_found
if there is no such bindingval find_state : ?who:State.t list -> t -> key -> State.t -> State.t
who
is set, automatically adds dependency from the found state
to each of states of who
.Not_found
if there is no such bindingval find_all_local : ?who:State.t list ->
t -> key -> State.t -> (data * State.t) list
who
is set, automatically adds dependency from each found state
to each of states of who
.val find_all_local_data : ?who:State.t list -> t -> key -> State.t -> data list
who
is set, automatically adds dependency from the state
corresponding to each data to each of states of who
.val find_all_local_states : ?who:State.t list -> t -> key -> State.t -> State.t list
who
is set, automatically adds dependency from each found state
to each of states of who
.val find_all : ?who:State.t list -> t -> key -> (data * State.t) list
who
is set, automatically adds dependency from each found state
to each of states of who
.val find_all_data : ?who:State.t list -> t -> key -> data list
who
is set, automatically adds dependency from the state
correspondin to of each found data to each of states of who
.val find_all_states : ?who:State.t list -> t -> key -> State.t list
who
is set, automatically adds dependency from each found state
to each of states of who
.val iter : (key -> State.t option -> data * State.t -> unit) ->
t -> unit
val iter_key : (State.t option -> data * State.t -> unit) ->
t -> key -> unit
val fold : (key -> State.t option -> data * State.t -> 'a -> 'a) ->
t -> 'a -> 'a
val fold_key : (State.t option -> data * State.t -> 'a -> 'a) ->
t -> key -> 'a -> 'a
val length : t -> int
type
marshaled
val marshaler : (t -> marshaled) * (marshaled -> t)