diff --git a/src/core/CCHashtbl.mli b/src/core/CCHashtbl.mli index 1016245f..dde46516 100644 --- a/src/core/CCHashtbl.mli +++ b/src/core/CCHashtbl.mli @@ -79,7 +79,10 @@ val to_list : ('a,'b) Hashtbl.t -> ('a * 'b) list (** List of bindings (order unspecified) *) val of_list : ('a * 'b) list -> ('a,'b) Hashtbl.t -(** From the given list of bindings, added in order *) +(** Build a table from the given list of bindings [k_i -> v_i], + added in order using {!add}. If a key occurs several times, + it will be added several times, and the visible binding + will be the last one. *) val update : ('a, 'b) Hashtbl.t -> f:('a -> 'b option -> 'b option) -> k:'a -> unit (** [update tbl ~f ~k] updates key [k] by calling [f k (Some v)] if @@ -165,7 +168,10 @@ module type S = sig (** List of bindings (order unspecified) *) val of_list : (key * 'a) list -> 'a t - (** From the given list of bindings, added in order *) + (** Build a table from the given list of bindings [k_i -> v_i], + added in order using {!add}. If a key occurs several times, + it will be added several times, and the visible binding + will be the last one. *) val update : 'a t -> f:(key -> 'a option -> 'a option) -> k:key -> unit (** [update tbl ~f ~k] updates key [k] by calling [f k (Some v)] if diff --git a/src/core/CCHeap.mli b/src/core/CCHeap.mli index 1713e3ce..3ba414f3 100644 --- a/src/core/CCHeap.mli +++ b/src/core/CCHeap.mli @@ -72,11 +72,16 @@ module type S = sig val to_list : t -> elt list - val add_list : t -> elt list -> t (** @since 0.16 *) + val add_list : t -> elt list -> t + (** Add the elements of the list to the heap. An element occurring several + times will be added that many times to the heap. + @since 0.16 *) val of_list : elt list -> t + (** [of_list l = add_list empty l] *) val add_seq : t -> elt sequence -> t (** @since 0.16 *) + (** Similar to {!add_list} *) val of_seq : elt sequence -> t diff --git a/src/core/CCMap.mli b/src/core/CCMap.mli index 662e2c1e..c545e6ea 100644 --- a/src/core/CCMap.mli +++ b/src/core/CCMap.mli @@ -33,6 +33,7 @@ module type S = sig @since 0.17 *) val of_seq : (key * 'a) sequence -> 'a t + (** Same as {!of_list} *) val add_seq : 'a t -> (key * 'a) sequence -> 'a t (** @since 0.14 *) @@ -40,6 +41,10 @@ module type S = sig val to_seq : 'a t -> (key * 'a) sequence val of_list : (key * 'a) list -> 'a t + (** Build a map from the given list of bindings [k_i -> v_i], + added in order using {!add}. + If a key occurs several times, only its last binding + will be present in the result. *) val add_list : 'a t -> (key * 'a) list -> 'a t (** @since 0.14 *) diff --git a/src/core/CCSet.mli b/src/core/CCSet.mli index 3388a162..4f36ccb7 100644 --- a/src/core/CCSet.mli +++ b/src/core/CCSet.mli @@ -19,6 +19,8 @@ module type S = sig val to_seq : t -> elt sequence val of_list : elt list -> t + (** Build a set from the given list of elements, + added in order using {!add}. *) val add_list : t -> elt list -> t (** @since 0.14 *)