Skip to content

Commit

Permalink
prepare for 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Nov 16, 2022
1 parent 24fdfdf commit 069423b
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 0.20.1
version = 0.22.4
profile=conventional
margin=80
if-then-else=k-r
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion containers-data.opam
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion containers-thread.opam
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion containers.opam
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCArray.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCArrayLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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)],
Expand Down
4 changes: 2 additions & 2 deletions src/core/CCInt64.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCRef.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions src/core/CCSeq.mli
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,23 @@ 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,
then [x] is repeated forever. *)

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. *)

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:
Expand All @@ -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. *)
Expand All @@ -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

Expand Down Expand Up @@ -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. *)
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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. *)
Expand All @@ -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.
Expand Down

0 comments on commit 069423b

Please sign in to comment.