From 069423bb772822071bf7b9c9b6eb2fe0ec8b2a83 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 16 Nov 2022 10:27:20 -0500 Subject: [PATCH] prepare for 3.10 --- .ocamlformat | 2 +- CHANGELOG.md | 12 ++++++++++++ containers-data.opam | 2 +- containers-thread.opam | 2 +- containers.opam | 2 +- src/core/CCArray.mli | 2 +- src/core/CCArrayLabels.mli | 2 +- src/core/CCInt64.mli | 4 ++-- src/core/CCRef.mli | 2 +- src/core/CCSeq.mli | 30 +++++++++++++++--------------- 10 files changed, 36 insertions(+), 24 deletions(-) diff --git a/.ocamlformat b/.ocamlformat index d2654159..c9862378 100644 --- a/.ocamlformat +++ b/.ocamlformat @@ -1,4 +1,4 @@ -version = 0.20.1 +version = 0.22.4 profile=conventional margin=80 if-then-else=k-r diff --git a/CHANGELOG.md b/CHANGELOG.md index acb09eaa..ffb8c5ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 3.10 + +- `CCArray`: add `mapi_inplace` +- add sublibrary `containers.scc` for strongly connected components +- `CCSeq`: add `concat_map` +- `CCSeq`: add some missing function from 4.14 +- add `CCInt64.{hash,hash_to_int64}` +- `Ref`: add `protect` function + +- fix: include `Seq` in `CCSeq` for ocaml >= 4.07 + ## 3.9 - feat: add `Containers_cbor` module @@ -9,6 +20,7 @@ * more extensive test suite * use `bytes` underneath, not an array of integers - add `containers_testlib`, removing qtest and ounit. +- `cbor`: use int64 as main int type - fix: handle uppercase in string/hex diff --git a/containers-data.opam b/containers-data.opam index 383becba..11b0d90b 100644 --- a/containers-data.opam +++ b/containers-data.opam @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "3.9" +version: "3.10" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" synopsis: "A set of advanced datatypes for containers" diff --git a/containers-thread.opam b/containers-thread.opam index a5cbc373..4d1d4f6a 100644 --- a/containers-thread.opam +++ b/containers-thread.opam @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "3.9" +version: "3.10" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" license: "BSD-2-Clause" diff --git a/containers.opam b/containers.opam index 2a436a48..d49e64ff 100644 --- a/containers.opam +++ b/containers.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "containers" -version: "3.9" +version: "3.10" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" license: "BSD-2-Clause" diff --git a/src/core/CCArray.mli b/src/core/CCArray.mli index a3258097..9aed2950 100644 --- a/src/core/CCArray.mli +++ b/src/core/CCArray.mli @@ -66,7 +66,7 @@ val map_inplace : ('a -> 'a) -> 'a t -> unit val mapi_inplace : (int -> 'a -> 'a) -> 'a t -> unit (** [mapi_inplace f a] replace all elements of [a] by its image by [f]. - @since NEXT_RELEASE *) + @since 3.10 *) val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a (** [fold f init a] computes [f (… (f (f init a.(0)) a.(1)) …) a.(n-1)], diff --git a/src/core/CCArrayLabels.mli b/src/core/CCArrayLabels.mli index 2cddc210..df5e3739 100644 --- a/src/core/CCArrayLabels.mli +++ b/src/core/CCArrayLabels.mli @@ -64,7 +64,7 @@ val map_inplace : f:('a -> 'a) -> 'a t -> unit val mapi_inplace : f:(int -> 'a -> 'a) -> 'a t -> unit (** [mapi_inplace ~f a] replace all elements of [a] by its image by [f]. - @since NEXT_RELEASE *) + @since 3.10 *) val fold : f:('a -> 'b -> 'a) -> init:'a -> 'b t -> 'a (** [fold ~f ~init a] computes [f (… (f (f init a.(0)) a.(1)) …) a.(n-1)], diff --git a/src/core/CCInt64.mli b/src/core/CCInt64.mli index 5fdd6770..d4e13e76 100644 --- a/src/core/CCInt64.mli +++ b/src/core/CCInt64.mli @@ -28,12 +28,12 @@ val max : t -> t -> t val hash : t -> int (** [hash x] computes the hash of [x], a non-negative integer. - Uses FNV since NEXT_RELEASE *) + Uses FNV since 3.10 *) val hash_to_int64 : t -> t (** Like {!hash} but does not truncate. Uses FNV. - @since NEXT_RELEASE *) + @since 3.10 *) val popcount : t -> int (** Number of bits set to 1. diff --git a/src/core/CCRef.mli b/src/core/CCRef.mli index e48deb45..8065dc75 100644 --- a/src/core/CCRef.mli +++ b/src/core/CCRef.mli @@ -36,7 +36,7 @@ val swap : 'a t -> 'a t -> unit val protect : 'a t -> 'a -> (unit -> 'b) -> 'b (** [protect r x f] sets [r := x]; calls [f()]; restores [r] to its old value; and returns the result of [f()]. - @since NEXT_RELEASE *) + @since 3.10 *) val compare : 'a ord -> 'a t ord val equal : 'a eq -> 'a t eq diff --git a/src/core/CCSeq.mli b/src/core/CCSeq.mli index 2de29176..210a60e6 100644 --- a/src/core/CCSeq.mli +++ b/src/core/CCSeq.mli @@ -32,7 +32,7 @@ val singleton : 'a -> 'a t val init : int -> (int -> 'a) -> 'a t (** [init n f] corresponds to the sequence [f 0; f 1; ...; f (n-1)]. @raise Invalid_argument if n is negative. - @since NEXT_RELEASE *) + @since 3.10 *) val repeat : ?n:int -> 'a -> 'a t (** [repeat ~n x] repeats [x] [n] times then stops. If [n] is omitted, @@ -40,7 +40,7 @@ val repeat : ?n:int -> 'a -> 'a t val forever : (unit -> 'a) -> 'a t (** [forever f] corresponds to the infinit sequence containing all the [f ()]. - @since NEXT_RELEASE *) + @since 3.10 *) val cycle : 'a t -> 'a t (** Cycle through the iterator infinitely. The iterator shouldn't be empty. *) @@ -48,7 +48,7 @@ val cycle : 'a t -> 'a t val iterate : ('a -> 'a) -> 'a -> 'a t (** [iterate f a] corresponds to the infinit sequence containing [a], [f a], [f (f a)], ...] - @since NEXT_RELEASE *) + @since 3.10 *) val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a t (** [unfold f acc] calls [f acc] and: @@ -74,7 +74,7 @@ val tail_exn : 'a t -> 'a t val uncons : 'a t -> ('a * 'a t) option (** [uncons xs] return [None] if [xs] is empty other - @since NEXT_RELEASE *) + @since 3.10 *) val equal : 'a equal -> 'a t equal (** Equality step by step. Eager. *) @@ -92,11 +92,11 @@ val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a (** [fold_lefti f init xs] applies [f acc i x] where [acc] is the result of the previous computation or [init] for the first one, [i] is the index in the sequence (starts at 0) and [x] is the element of the sequence. - @since NEXT_RELEASE *) + @since 3.10 *) val fold_lefti : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a (** Alias of {!foldi}. - @since NEXT_RELEASE *) + @since 3.10 *) val iter : ('a -> unit) -> 'a t -> unit @@ -127,7 +127,7 @@ val product_with : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val map_product : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t (** Alias of {!product_with}. - @since NEXT_RELEASE *) + @since 3.10 *) val product : 'a t -> 'b t -> ('a * 'b) t (** Specialization of {!product_with} producing tuples. *) @@ -159,29 +159,29 @@ val exists : ('a -> bool) -> 'a t -> bool val find : ('a -> bool) -> 'a t -> 'a option (** [find p [a1; ...; an]] return [Some ai] for the first [ai] satisfying the predicate [p] and return [None] otherwise. - @since NEXT_RELEASE *) + @since 3.10 *) val find_map : ('a -> 'b option) -> 'a t -> 'b option (** [find f [a1; ...; an]] return [Some (f ai)] for the first [ai] such that [f ai = Some _] and return [None] otherwise. - @since NEXT_RELEASE *) + @since 3.10 *) val scan : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a t (** [scan f init xs] is the sequence containing the intermediate result of [fold f init xs]. - @since NEXT_RELEASE *) + @since 3.10 *) val flat_map : ('a -> 'b t) -> 'a t -> 'b t val concat_map : ('a -> 'b t) -> 'a t -> 'b t (** Aliass of {!flat_map} - @since NEXT_RELEASE *) + @since 3.10 *) val filter_map : ('a -> 'b option) -> 'a t -> 'b t val flatten : 'a t t -> 'a t val concat : 'a t t -> 'a t (** Alias of {!flatten}. - @since NEXT_RELEASE *) + @since 3.10 *) val range : int -> int -> int t @@ -199,7 +199,7 @@ val fold2 : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> 'a t -> 'b t -> 'acc val fold_left2 : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> 'a t -> 'b t -> 'acc (** Alias for {!fold2}. - @since NEXT_RELEASE *) + @since 3.10 *) val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t (** Map on two collections at once. Stop as soon as one of the @@ -216,7 +216,7 @@ val merge : 'a ord -> 'a t -> 'a t -> 'a t val sorted_merge : 'a ord -> 'a t -> 'a t -> 'a t (** Alias of {!merge}. - @since NEXT_RELEASE *) + @since 3.10 *) val zip : 'a t -> 'b t -> ('a * 'b) t (** Combine elements pairwise. Stop as soon as one of the lists stops. *) @@ -226,7 +226,7 @@ val unzip : ('a * 'b) t -> 'a t * 'b t val split : ('a * 'b) t -> 'a t * 'b t (** Alias of {!unzip}. - @since NEXT_RELEASE *) + @since 3.10 *) val zip_i : 'a t -> (int * 'a) t (** [zip_i seq] zips the index of each element with the element itself.