Module Globnames.ExtRefMap
The underlying Map library
include CSig.MapS
val empty : 'a tval is_empty : 'a t -> boolval mem : key -> 'a t -> boolval add : key -> 'a -> 'a t -> 'a tval singleton : key -> 'a -> 'a tval remove : key -> 'a t -> 'a tval merge : (key -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c tval union : (key -> 'a -> 'a -> 'a option) -> 'a t -> 'a t -> 'a tval compare : ('a -> 'a -> int) -> 'a t -> 'a t -> intval equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> boolval iter : (key -> 'a -> unit) -> 'a t -> unitval fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'bval for_all : (key -> 'a -> bool) -> 'a t -> boolval exists : (key -> 'a -> bool) -> 'a t -> boolval filter : (key -> 'a -> bool) -> 'a t -> 'a tval partition : (key -> 'a -> bool) -> 'a t -> 'a t * 'a tval cardinal : 'a t -> intval bindings : 'a t -> (key * 'a) listval min_binding : 'a t -> key * 'aval max_binding : 'a t -> key * 'aval choose : 'a t -> key * 'aval choose_opt : 'a t -> (key * 'a) optionval split : key -> 'a t -> 'a t * 'a option * 'a tval find : key -> 'a t -> 'aval find_opt : key -> 'a t -> 'a optionval map : ('a -> 'b) -> 'a t -> 'b tval mapi : (key -> 'a -> 'b) -> 'a t -> 'b t
val set : key -> 'a -> 'a t -> 'a tSame as
add, but expects the key to be present, and thus faster.- raises Not_found
when the key is unbound in the map.
val modify : key -> (key -> 'a -> 'a) -> 'a t -> 'a tApply the given function to the binding of the given key.
- raises Not_found
when the key is unbound in the map.
val bind : (key -> 'a) -> Set.t -> 'a tbind f stransform the setx1; ...; xnintox1 := f x1; ...; xn := f xn.
val fold_left : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'bAlias for
fold, to easily track where we depend on fold order.
val height : 'a t -> intAn indication of the logarithmic size of a map
val filter_range : (key -> int) -> 'a t -> 'a tfind_range in_range mGiven a comparison functionin_range x, that tests ifxis below, above, or inside a given rangefilter_rangereturns the submap ofmwhose keys are in range. Note thatin_rangehas to define a continouous range.
val update : key -> ('a option -> 'a option) -> 'a t -> 'a tupdate x f mreturns a map containing the same bindings asm, except for the binding ofx. Depending on the value ofywhereyisf (find_opt x m), the binding ofxis added, removed or updated. IfyisNone, the binding is removed if it exists; otherwise, ifyisSome zthenxis associated tozin the resulting map. Ifxwas already bound inmto a value that is physically equal toz,mis returned unchanged (the result of the function is then physically equal tom).
module Smart : sig ... endmodule Unsafe : sig ... endmodule Monad : functor (M : CMap.MonadS) -> sig ... endFold operators parameterized by any monad.