Reg.Map
include Ppx_compare_lib.Comparable.S1 with type +'a t := 'a t
val compare :
'a Base__Ppx_compare_lib.compare ->
'a t Base__Ppx_compare_lib.compare
include Ppx_compare_lib.Equal.S1 with type +'a t := 'a t
val equal : 'a Base__Ppx_compare_lib.equal -> 'a t Base__Ppx_compare_lib.equal
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
val sexp_of_compare :
('compare_a -> Sexplib0.Sexp.t) ->
'compare_a compare ->
Sexplib0.Sexp.t
val compare_of_sexp :
(Sexplib0.Sexp.t -> 'compare_a) ->
Sexplib0.Sexp.t ->
'compare_a compare
module Provide_of_sexp (_ : sig ... end) : sig ... end
val empty : 'a t
val singleton : Llair__.LlairExp.Reg.exp -> 'a -> 'a t
Add a binding if the key is not already bound.
val merge_endo :
'a t ->
'b t ->
f:
(Llair__.LlairExp.Reg.exp ->
[ `Left of 'a | `Both of 'a * 'b | `Right of 'b ] ->
'a option) ->
'a t
Like merge, but specialized to require f
to preserve the type of the left argument, which enables preserving ==
if f
preserves ==
of every value.
union_absent m1 m2
contains all the bindings of m1
as well as those of m2
for keys not contained by m1
. union_absent m1 m2 == m1
if no bindings from m2
are added.
val is_empty : 'a t -> bool
val is_singleton : 'a t -> bool
val length : 'a t -> int
val only_binding : 'a t -> (Llair__.LlairExp.Reg.exp * 'a) option
val classify : 'a t -> (Llair__.LlairExp.Reg.exp, 'a) NS__.NS0.zero_one_many2
val choose : 'a t -> (Llair__.LlairExp.Reg.exp * 'a) option
Find an unspecified binding. Different bindings may be chosen for equivalent maps. O(1)
.
val choose_exn : 'a t -> Llair__.LlairExp.Reg.exp * 'a
Find an unspecified binding. Different bindings may be chosen for equivalent maps. O(1)
.
val min_binding : 'a t -> (Llair__.LlairExp.Reg.exp * 'a) option
val max_binding : 'a t -> (Llair__.LlairExp.Reg.exp * 'a) option
val max_binding_exn : 'a t -> Llair__.LlairExp.Reg.exp * 'a
val mem : Llair__.LlairExp.Reg.exp -> 'a t -> bool
val find : Llair__.LlairExp.Reg.exp -> 'a t -> 'a option
val find_exn : Llair__.LlairExp.Reg.exp -> 'a t -> 'a
val find_multi : Llair__.LlairExp.Reg.exp -> 'a list t -> 'a list
val find_update :
Llair__.LlairExp.Reg.exp ->
'a t ->
f:('a option -> 'a option) ->
'a option * 'a t
find_update k f m
is (found, m')
where found
is find k m
and find k m'
is f found
and find h m'
is find h m
for all other h
.
Find and remove the binding for a key.
Find the value bound to the given key if there is one, or otherwise add a binding for the given key and value.
val find_or_add_lazy :
Llair__.LlairExp.Reg.exp ->
'a t ->
f:(unit -> 'a) ->
[> `Added of 'a | `Found of 'a ] * 'a t
Find the value bound to the given key if there is one, or otherwise add a binding for the given key with value f ()
.
Find and remove binding with minimum key. O(log n)
.
Like map, but specialized to require f
to be an endofunction, which enables preserving ==
if f
preserves ==
of every value.
val iter : 'a t -> f:('a -> unit) -> unit
val iteri : 'a t -> f:(key:Llair__.LlairExp.Reg.exp -> data:'a -> unit) -> unit
val existsi :
'a t ->
f:(key:Llair__.LlairExp.Reg.exp -> data:'a -> bool) ->
bool
val for_alli :
'a t ->
f:(key:Llair__.LlairExp.Reg.exp -> data:'a -> bool) ->
bool
val fold :
'a t ->
's ->
f:(key:Llair__.LlairExp.Reg.exp -> data:'a -> 's -> 's) ->
's
val fold_until :
'a t ->
's ->
f:
(key:Llair__.LlairExp.Reg.exp ->
data:'a ->
's ->
[ `Continue of 's | `Stop of 'b ]) ->
finish:('s -> 'b) ->
'b
val keys : 'a t -> (Llair__.LlairExp.Reg.exp -> unit) -> unit
val values : 'a t -> ('a -> unit) -> unit
val to_iter : 'a t -> ((Llair__.LlairExp.Reg.exp * 'a) -> unit) -> unit
val to_list : 'a t -> (Llair__.LlairExp.Reg.exp * 'a) list
val of_iter : (((Llair__.LlairExp.Reg.exp * 'a) -> unit) -> unit) -> 'a t
val of_list : (Llair__.LlairExp.Reg.exp * 'a) list -> 'a t
val pp :
(Stdlib.Format.formatter -> Llair__.LlairExp.Reg.exp -> unit) ->
(Stdlib.Format.formatter -> 'a -> unit) ->
Stdlib.Format.formatter ->
'a t ->
unit
val pp_diff :
?pre:(unit, Stdlib.Format.formatter, unit, unit) Stdlib.format4 ->
?suf:(unit, Stdlib.Format.formatter, unit, unit) Stdlib.format4 ->
?sep:(unit, Stdlib.Format.formatter, unit, unit) Stdlib.format4 ->
(Stdlib.Format.formatter -> Llair__.LlairExp.Reg.exp -> unit) ->
(Stdlib.Format.formatter -> 'a -> unit) ->
(Stdlib.Format.formatter -> ('a * 'a) -> unit) ->
eq:('a -> 'a -> bool) ->
Stdlib.Format.formatter ->
('a t * 'a t) ->
unit