mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
prepare for 3.10
This commit is contained in:
parent
24fdfdf3ee
commit
069423bb77
10 changed files with 36 additions and 24 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
version = 0.20.1
|
version = 0.22.4
|
||||||
profile=conventional
|
profile=conventional
|
||||||
margin=80
|
margin=80
|
||||||
if-then-else=k-r
|
if-then-else=k-r
|
||||||
|
|
|
||||||
12
CHANGELOG.md
12
CHANGELOG.md
|
|
@ -1,5 +1,16 @@
|
||||||
# Changelog
|
# 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
|
## 3.9
|
||||||
|
|
||||||
- feat: add `Containers_cbor` module
|
- feat: add `Containers_cbor` module
|
||||||
|
|
@ -9,6 +20,7 @@
|
||||||
* more extensive test suite
|
* more extensive test suite
|
||||||
* use `bytes` underneath, not an array of integers
|
* use `bytes` underneath, not an array of integers
|
||||||
- add `containers_testlib`, removing qtest and ounit.
|
- add `containers_testlib`, removing qtest and ounit.
|
||||||
|
- `cbor`: use int64 as main int type
|
||||||
|
|
||||||
- fix: handle uppercase in string/hex
|
- fix: handle uppercase in string/hex
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
version: "3.9"
|
version: "3.10"
|
||||||
author: "Simon Cruanes"
|
author: "Simon Cruanes"
|
||||||
maintainer: "simon.cruanes.2007@m4x.org"
|
maintainer: "simon.cruanes.2007@m4x.org"
|
||||||
synopsis: "A set of advanced datatypes for containers"
|
synopsis: "A set of advanced datatypes for containers"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
version: "3.9"
|
version: "3.10"
|
||||||
author: "Simon Cruanes"
|
author: "Simon Cruanes"
|
||||||
maintainer: "simon.cruanes.2007@m4x.org"
|
maintainer: "simon.cruanes.2007@m4x.org"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
name: "containers"
|
name: "containers"
|
||||||
version: "3.9"
|
version: "3.10"
|
||||||
author: "Simon Cruanes"
|
author: "Simon Cruanes"
|
||||||
maintainer: "simon.cruanes.2007@m4x.org"
|
maintainer: "simon.cruanes.2007@m4x.org"
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ val map_inplace : ('a -> 'a) -> 'a t -> unit
|
||||||
|
|
||||||
val mapi_inplace : (int -> '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].
|
(** [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
|
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)],
|
(** [fold f init a] computes [f (… (f (f init a.(0)) a.(1)) …) a.(n-1)],
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ val map_inplace : f:('a -> 'a) -> 'a t -> unit
|
||||||
|
|
||||||
val mapi_inplace : f:(int -> '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].
|
(** [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
|
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)],
|
(** [fold ~f ~init a] computes [f (… (f (f init a.(0)) a.(1)) …) a.(n-1)],
|
||||||
|
|
|
||||||
|
|
@ -28,12 +28,12 @@ val max : t -> t -> t
|
||||||
|
|
||||||
val hash : t -> int
|
val hash : t -> int
|
||||||
(** [hash x] computes the hash of [x], a non-negative integer.
|
(** [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
|
val hash_to_int64 : t -> t
|
||||||
(** Like {!hash} but does not truncate.
|
(** Like {!hash} but does not truncate.
|
||||||
Uses FNV.
|
Uses FNV.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val popcount : t -> int
|
val popcount : t -> int
|
||||||
(** Number of bits set to 1.
|
(** Number of bits set to 1.
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ val swap : 'a t -> 'a t -> unit
|
||||||
val protect : 'a t -> 'a -> (unit -> 'b) -> 'b
|
val protect : 'a t -> 'a -> (unit -> 'b) -> 'b
|
||||||
(** [protect r x f] sets [r := x]; calls [f()]; restores [r] to its old value;
|
(** [protect r x f] sets [r := x]; calls [f()]; restores [r] to its old value;
|
||||||
and returns the result of [f()].
|
and returns the result of [f()].
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val compare : 'a ord -> 'a t ord
|
val compare : 'a ord -> 'a t ord
|
||||||
val equal : 'a eq -> 'a t eq
|
val equal : 'a eq -> 'a t eq
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ val singleton : 'a -> 'a t
|
||||||
val init : int -> (int -> 'a) -> 'a t
|
val init : int -> (int -> 'a) -> 'a t
|
||||||
(** [init n f] corresponds to the sequence [f 0; f 1; ...; f (n-1)].
|
(** [init n f] corresponds to the sequence [f 0; f 1; ...; f (n-1)].
|
||||||
@raise Invalid_argument if n is negative.
|
@raise Invalid_argument if n is negative.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val repeat : ?n:int -> 'a -> 'a t
|
val repeat : ?n:int -> 'a -> 'a t
|
||||||
(** [repeat ~n x] repeats [x] [n] times then stops. If [n] is omitted,
|
(** [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
|
val forever : (unit -> 'a) -> 'a t
|
||||||
(** [forever f] corresponds to the infinit sequence containing all the [f ()].
|
(** [forever f] corresponds to the infinit sequence containing all the [f ()].
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val cycle : 'a t -> 'a t
|
val cycle : 'a t -> 'a t
|
||||||
(** Cycle through the iterator infinitely. The iterator shouldn't be empty. *)
|
(** 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
|
val iterate : ('a -> 'a) -> 'a -> 'a t
|
||||||
(** [iterate f a] corresponds to the infinit sequence containing [a], [f a], [f (f a)],
|
(** [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
|
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a t
|
||||||
(** [unfold f acc] calls [f acc] and:
|
(** [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
|
val uncons : 'a t -> ('a * 'a t) option
|
||||||
(** [uncons xs] return [None] if [xs] is empty other
|
(** [uncons xs] return [None] if [xs] is empty other
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val equal : 'a equal -> 'a t equal
|
val equal : 'a equal -> 'a t equal
|
||||||
(** Equality step by step. Eager. *)
|
(** 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
|
(** [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
|
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.
|
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
|
val fold_lefti : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a
|
||||||
(** Alias of {!foldi}.
|
(** Alias of {!foldi}.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val iter : ('a -> unit) -> 'a t -> unit
|
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
|
val map_product : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
|
||||||
(** Alias of {!product_with}.
|
(** Alias of {!product_with}.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val product : 'a t -> 'b t -> ('a * 'b) t
|
val product : 'a t -> 'b t -> ('a * 'b) t
|
||||||
(** Specialization of {!product_with} producing tuples. *)
|
(** 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
|
val find : ('a -> bool) -> 'a t -> 'a option
|
||||||
(** [find p [a1; ...; an]] return [Some ai] for the first [ai] satisfying the predicate
|
(** [find p [a1; ...; an]] return [Some ai] for the first [ai] satisfying the predicate
|
||||||
[p] and return [None] otherwise.
|
[p] and return [None] otherwise.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val find_map : ('a -> 'b option) -> 'a t -> 'b option
|
val find_map : ('a -> 'b option) -> 'a t -> 'b option
|
||||||
(** [find f [a1; ...; an]] return [Some (f ai)] for the first [ai] such that
|
(** [find f [a1; ...; an]] return [Some (f ai)] for the first [ai] such that
|
||||||
[f ai = Some _] and return [None] otherwise.
|
[f ai = Some _] and return [None] otherwise.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val scan : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a t
|
val scan : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a t
|
||||||
(** [scan f init xs] is the sequence containing the intermediate result of
|
(** [scan f init xs] is the sequence containing the intermediate result of
|
||||||
[fold f init xs].
|
[fold f init xs].
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val flat_map : ('a -> 'b t) -> 'a t -> 'b t
|
val flat_map : ('a -> 'b t) -> 'a t -> 'b t
|
||||||
val concat_map : ('a -> 'b t) -> 'a t -> 'b t
|
val concat_map : ('a -> 'b t) -> 'a t -> 'b t
|
||||||
(** Aliass of {!flat_map}
|
(** Aliass of {!flat_map}
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val filter_map : ('a -> 'b option) -> 'a t -> 'b t
|
val filter_map : ('a -> 'b option) -> 'a t -> 'b t
|
||||||
|
|
||||||
val flatten : 'a t t -> 'a t
|
val flatten : 'a t t -> 'a t
|
||||||
val concat : 'a t t -> 'a t
|
val concat : 'a t t -> 'a t
|
||||||
(** Alias of {!flatten}.
|
(** Alias of {!flatten}.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val range : int -> int -> int t
|
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
|
val fold_left2 : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> 'a t -> 'b t -> 'acc
|
||||||
(** Alias for {!fold2}.
|
(** Alias for {!fold2}.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
|
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
|
||||||
(** Map on two collections at once. Stop as soon as one of the
|
(** 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
|
val sorted_merge : 'a ord -> 'a t -> 'a t -> 'a t
|
||||||
(** Alias of {!merge}.
|
(** Alias of {!merge}.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val zip : 'a t -> 'b t -> ('a * 'b) t
|
val zip : 'a t -> 'b t -> ('a * 'b) t
|
||||||
(** Combine elements pairwise. Stop as soon as one of the lists stops. *)
|
(** 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
|
val split : ('a * 'b) t -> 'a t * 'b t
|
||||||
(** Alias of {!unzip}.
|
(** Alias of {!unzip}.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.10 *)
|
||||||
|
|
||||||
val zip_i : 'a t -> (int * 'a) t
|
val zip_i : 'a t -> (int * 'a) t
|
||||||
(** [zip_i seq] zips the index of each element with the element itself.
|
(** [zip_i seq] zips the index of each element with the element itself.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue