prepare for 3.10

This commit is contained in:
Simon Cruanes 2022-11-16 10:27:20 -05:00
parent 24fdfdf3ee
commit 069423bb77
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
10 changed files with 36 additions and 24 deletions

View file

@ -1,4 +1,4 @@
version = 0.20.1
version = 0.22.4
profile=conventional
margin=80
if-then-else=k-r

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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)],

View file

@ -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)],

View file

@ -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.

View file

@ -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

View file

@ -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.