diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 243ca1226..567fe8aeb 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -1,5 +1,18 @@ = Changelog +== 2.2 + +- Improving comments presentation +- Add `CCOpt.return_if` +- Add `CCOpt.flatten` +- Add `CCString.{,r}drop_while` +- add many missing functions to `CCListLabels` +- test: consistency `CCList{,Labels}` + +- fix(arrayLabels): compatibility with 4.07 +- fix: compatibility for CCArrayLabels +- test: add compatibility checks between `CCArray{,Labels}` + == 2.1 - make `CCInt64` compatible with `Int64` (breaking!) (closes #192) diff --git a/README.adoc b/README.adoc index 9050155fd..a0fc756da 100644 --- a/README.adoc +++ b/README.adoc @@ -560,8 +560,6 @@ can be removed. removed deprecated functions, etc. . update `CHANGELOG.adoc` (see its end to find the right git command) . commit the changes -. `git checkout stable` -. `git merge master` . `make test doc` . tag, and push both to github . `opam pin add containers https://github.com/c-cube/ocaml-containers.git#` diff --git a/containers.opam b/containers.opam index ded5b0ed7..6372693d6 100644 --- a/containers.opam +++ b/containers.opam @@ -1,6 +1,6 @@ opam-version: "1.2" name: "containers" -version: "2.1" +version: "2.2" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" build: [ diff --git a/src/core/CCListLabels.mli b/src/core/CCListLabels.mli index f0459b61d..efec8391b 100644 --- a/src/core/CCListLabels.mli +++ b/src/core/CCListLabels.mli @@ -66,7 +66,7 @@ val fold_map : f:('acc -> 'a -> 'acc * 'b) -> init:'acc -> 'a list -> 'acc * 'b @since 0.14 *) val scan_left : f:('acc -> 'a -> 'acc) -> init:'acc -> 'a list -> 'acc list -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val fold_map2 : f:('acc -> 'a -> 'b -> 'acc * 'c) -> init:'acc -> 'a list -> 'b list -> 'acc * 'c list (** [fold_map2] is to [fold_map] what [List.map2] is to [List.map]. @@ -84,7 +84,7 @@ val fold_flat_map : f:('acc -> 'a -> 'acc * 'b list) -> init:'acc -> 'a list -> @since 0.14 *) val count : f:('a -> bool) -> 'a list -> int -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val init : int -> f:(int -> 'a) -> 'a t (** [init len ~f] is [f 0; f 1; ...; f (len-1)]. @@ -92,21 +92,21 @@ val init : int -> f:(int -> 'a) -> 'a t @since 0.6 *) val combine : 'a list -> 'b list -> ('a * 'b) list -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val combine_gen : 'a list -> 'b list -> ('a * 'b) gen -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val split : ('a * 'b) t -> 'a t * 'b t -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val compare_lengths : 'a t -> 'b t -> int -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val compare_length_with : 'a t -> int -> int -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool @@ -123,10 +123,10 @@ val fold_product : f:('c -> 'a -> 'b -> 'c) -> init:'c -> 'a t -> 'b t -> 'c (** Fold on the cartesian product. *) val cartesian_product : 'a t t -> 'a t t -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val map_product_l : f:('a -> 'b list) -> 'a list -> 'b list list -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val diagonal : 'a t -> ('a * 'a) t (** All pairs of distinct positions of the list. [list_diagonal l] will return the list of [List.nth i l, List.nth j l] if [i < j]. *) @@ -155,12 +155,12 @@ val sublists_of_len : val intersperse : x:'a -> 'a list -> 'a list (** Insert the first argument between every element of the list. - @since NEXT_RELEASE *) + @since 2.2 *) val interleave : 'a list -> 'a list -> 'a list (** [interleave [x1…xn] [y1…ym]] is [x1,y1,x2,y2,…] and finishes with the suffix of the longest list. - @since NEXT_RELEASE *) + @since 2.2 *) val pure : 'a -> 'a t (** [pure] is [return]. *) @@ -201,7 +201,7 @@ val drop_while : f:('a -> bool) -> 'a t -> 'a t @since 0.13 *) val take_drop_while : f:('a -> bool) -> 'a t -> 'a t * 'a t -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val last : int -> 'a t -> 'a t (** [last n l] takes the last [n] elements of [l] (or less if @@ -225,7 +225,7 @@ val find_pred : f:('a -> bool) -> 'a t -> 'a option @since 0.11 *) val find_opt : f:('a -> bool) -> 'a t -> 'a option -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val find_pred_exn : f:('a -> bool) -> 'a t -> 'a (** Unsafe version of {!find_pred}. @@ -257,16 +257,16 @@ val filter_map : f:('a -> 'b option) -> 'a t -> 'b t Map and remove elements at the same time. *) val keep_some : 'a option t -> 'a t -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val keep_ok : ('a, _) Result.result t -> 'a t -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val all_some : 'a option t -> 'a t option -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val all_ok : ('a, 'err) Result.result t -> ('a t, 'err) Result.result -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val sorted_merge : cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list (** Merges elements from both sorted list. *) @@ -316,13 +316,13 @@ val iteri : f:(int -> 'a -> unit) -> 'a t -> unit itself as second argument. *) val iteri2 : f:(int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val foldi : f:('b -> int -> 'a -> 'b) -> init:'b -> 'a t -> 'b (** Like [fold] but it also passes in the index of each element to the folded function. Tail-recursive. *) val foldi2 : f:('c -> int -> 'a -> 'b -> 'c) -> init:'c -> 'a t -> 'b t -> 'c -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val get_at_idx : int -> 'a t -> 'a option (** Get by index in the list. @@ -330,7 +330,7 @@ val get_at_idx : int -> 'a t -> 'a option of the list. *) val nth_opt : 'a t -> int -> 'a option -(** @since NEXT_RELEASE *) +(** @since 2.2 *) val get_at_idx_exn : int -> 'a t -> 'a (** Get the i-th element, or diff --git a/src/core/CCOpt.mli b/src/core/CCOpt.mli index 4700cdd14..e6041177e 100644 --- a/src/core/CCOpt.mli +++ b/src/core/CCOpt.mli @@ -124,13 +124,13 @@ val choice : 'a t list -> 'a t val flatten : 'a t t -> 'a t (** [flatten] transforms [Some x] into [x]. - @since NEXT_RELEASE *) + @since 2.2 *) val return_if : bool -> 'a -> 'a t (** Apply [Some] or [None] depending on a boolean. More precisely, [return_if false x] is [None], and [return_if true x] is [Some x]. - @since NEXT_RELEASE *) + @since 2.2 *) (** {2 Infix Operators} @since 0.16 *) diff --git a/src/core/CCString.mli b/src/core/CCString.mli index e1eabf663..eb4734f21 100644 --- a/src/core/CCString.mli +++ b/src/core/CCString.mli @@ -249,12 +249,12 @@ include S with type t := string val drop_while : (char -> bool) -> t -> t (** [drop_while f s] discards any characters starting from the left, up to the first character [c] not satisfying [f c]. - @since NEXT_RELEASE *) + @since 2.2 *) val rdrop_while : (char -> bool) -> t -> t (** [rdrop_while f s] discards any characters starting from the right, up to the first character [c] not satisfying [f c]. - @since NEXT_RELEASE *) + @since 2.2 *) val ltrim : t -> t (** Trim space on the left (see {!String.trim} for more details).