diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fcf096a4..8302baef9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 3.12 + +- add `containers.pp` sublibrary, with Wadler-style pretty printing combinators +- add `CCArray.{max,argmax,min,argmin}` and their _exn counterparts +- add `CCParse.take_until_success` +- add `Option.flat_map_l` +- add `CCSet.{find_first_map,find_last_map}` +- `CCHash`: native FNV hash for int64/int32 + +- fix bugs in CCParse related to `recurse` and `Slice` +- fix: fix Set.find_last_map on OCaml 4.03 +- fix: make sure `Vector.to_{seq,gen}` captures the length initially + ## 3.11 - official OCaml 5 support diff --git a/containers-data.opam b/containers-data.opam index d2d64cfff..cce5f9e3b 100644 --- a/containers-data.opam +++ b/containers-data.opam @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "3.11" +version: "3.12" 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 2b2d71977..b388c91a4 100644 --- a/containers-thread.opam +++ b/containers-thread.opam @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "3.11" +version: "3.12" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" license: "BSD-2-Clause" diff --git a/containers.opam b/containers.opam index cf989702e..a6fe00986 100644 --- a/containers.opam +++ b/containers.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "containers" -version: "3.11" +version: "3.12" 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 8c56355d6..4ec5b1a94 100644 --- a/src/core/CCArray.mli +++ b/src/core/CCArray.mli @@ -145,43 +145,43 @@ val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option val max : ('a -> 'a -> int) -> 'a t -> 'a option (** [max cmp a] returns [None] if [a] is empty, otherwise, returns [Some e] where [e] is a maximum element in [a] with respect to [cmp]. - @since NEXT_RELEASE *) + @since 3.12 *) val max_exn : ('a -> 'a -> int) -> 'a t -> 'a (** [max_exn cmp a] is like {!max}, but @raise Invalid_argument if [a] is empty. - @since NEXT_RELEASE *) + @since 3.12 *) val argmax : ('a -> 'a -> int) -> 'a t -> int option (** [argmax cmp a] returns [None] if [a] is empty, otherwise, returns [Some i] where [i] is the index of a maximum element in [a] with respect to [cmp]. - @since NEXT_RELEASE *) + @since 3.12 *) val argmax_exn : ('a -> 'a -> int) -> 'a t -> int (** [argmax_exn cmp a] is like {!argmax}, but @raise Invalid_argument if [a] is empty. - @since NEXT_RELEASE *) + @since 3.12 *) val min : ('a -> 'a -> int) -> 'a t -> 'a option (** [min cmp a] returns [None] if [a] is empty, otherwise, returns [Some e] where [e] is a minimum element in [a] with respect to [cmp]. - @since NEXT_RELEASE *) + @since 3.12 *) val min_exn : ('a -> 'a -> int) -> 'a t -> 'a (** [min_exn cmp a] is like {!min}, but @raise Invalid_argument if [a] is empty. - @since NEXT_RELEASE *) + @since 3.12 *) val argmin : ('a -> 'a -> int) -> 'a t -> int option (** [argmin cmp a] returns [None] if [a] is empty, otherwise, returns [Some i] where [i] is the index of a minimum element in [a] with respect to [cmp]. - @since NEXT_RELEASE *) + @since 3.12 *) val argmin_exn : ('a -> 'a -> int) -> 'a t -> int (** [argmin_exn cmp a] is like {!argmin}, but @raise Invalid_argument if [a] is empty. - @since NEXT_RELEASE *) + @since 3.12 *) val lookup : cmp:'a ord -> 'a -> 'a t -> int option (** [lookup ~cmp key a] lookups the index of some key [key] in a sorted array [a]. diff --git a/src/core/CCArrayLabels.mli b/src/core/CCArrayLabels.mli index b8725703d..6da095703 100644 --- a/src/core/CCArrayLabels.mli +++ b/src/core/CCArrayLabels.mli @@ -144,43 +144,43 @@ val find_idx : f:('a -> bool) -> 'a t -> (int * 'a) option val max : cmp:('a -> 'a -> int) -> 'a t -> 'a option (** [max ~cmp a] returns [None] if [a] is empty, otherwise, returns [Some e] where [e] is a maximum element in [a] with respect to [cmp]. - @since NEXT_RELEASE *) + @since 3.12 *) val max_exn : cmp:('a -> 'a -> int) -> 'a t -> 'a (** [max_exn ~cmp a] is like {!max}, but @raise Invalid_argument if [a] is empty. - @since NEXT_RELEASE *) + @since 3.12 *) val argmax : cmp:('a -> 'a -> int) -> 'a t -> int option (** [argmax ~cmp a] returns [None] if [a] is empty, otherwise, returns [Some i] where [i] is the index of a maximum element in [a] with respect to [cmp]. - @since NEXT_RELEASE *) + @since 3.12 *) val argmax_exn : cmp:('a -> 'a -> int) -> 'a t -> int (** [argmax_exn ~cmp a] is like {!argmax}, but @raise Invalid_argument if [a] is empty. - @since NEXT_RELEASE *) + @since 3.12 *) val min : cmp:('a -> 'a -> int) -> 'a t -> 'a option (** [min ~cmp a] returns [None] if [a] is empty, otherwise, returns [Some e] where [e] is a minimum element in [a] with respect to [cmp]. - @since NEXT_RELEASE *) + @since 3.12 *) val min_exn : cmp:('a -> 'a -> int) -> 'a t -> 'a (** [min_exn ~cmp a] is like {!min}, but @raise Invalid_argument if [a] is empty. - @since NEXT_RELEASE *) + @since 3.12 *) val argmin : cmp:('a -> 'a -> int) -> 'a t -> int option (** [argmin ~cmp a] returns [None] if [a] is empty, otherwise, returns [Some i] where [i] is the index of a minimum element in [a] with respect to [cmp]. - @since NEXT_RELEASE *) + @since 3.12 *) val argmin_exn : cmp:('a -> 'a -> int) -> 'a t -> int (** [argmin_exn ~cmp a] is like {!argmin}, but @raise Invalid_argument if [a] is empty. - @since NEXT_RELEASE *) + @since 3.12 *) val lookup : cmp:('a ord[@keep_label]) -> key:'a -> 'a t -> int option (** [lookup ~cmp ~key a] lookups the index of some key [key] in a sorted array [a]. diff --git a/src/core/CCOption.mli b/src/core/CCOption.mli index d305449bb..24c0d4c5d 100644 --- a/src/core/CCOption.mli +++ b/src/core/CCOption.mli @@ -51,7 +51,7 @@ val flat_map : ('a -> 'b t) -> 'a t -> 'b t val flat_map_l : ('a -> 'b list) -> 'a t -> 'b list (** [flat_map_l f o] is [[]] if [o] is [None], or [f x] if [o] is [Some x]. - @since NEXT_RELEASE *) + @since 3.12 *) val bind : 'a t -> ('a -> 'b t) -> 'b t (** [bind o f] is [f v] if [o] is [Some v], [None] otherwise. diff --git a/src/core/CCParse.mli b/src/core/CCParse.mli index a2fa58c1c..cc98dd190 100644 --- a/src/core/CCParse.mli +++ b/src/core/CCParse.mli @@ -310,7 +310,7 @@ val take_until_success : 'a t -> (slice * 'a) t {b NOTE} performance wise, if [p] does a lot of work at each position, this can be costly (thing naive substring search if [p] is [string "very long needle"]). - @since NEXT_RELEASE *) + @since 3.12 *) val take : int -> slice t (** [take len] parses exactly [len] characters from the input. diff --git a/src/core/CCSet.ml b/src/core/CCSet.ml index 022a7daab..9d6e9d463 100644 --- a/src/core/CCSet.ml +++ b/src/core/CCSet.ml @@ -37,7 +37,7 @@ module type S = sig val find_first_map : (elt -> 'a option) -> t -> 'a option (** [find_first_map f s] find the minimum element [x] of [s] such that [f x = Some y] and return [Some y]. Otherwise returns [None]. - @since NEXT_RELEASE *) + @since 3.12 *) val find_last : (elt -> bool) -> t -> elt (** Find maximum element satisfying predicate. @@ -50,7 +50,7 @@ module type S = sig val find_last_map : (elt -> 'a option) -> t -> 'a option (** [find_last_map f s] find the maximum element [x] of [s] such that [f x = Some y] and return [Some y]. Otherwise returns [None]. - @since NEXT_RELEASE *) + @since 3.12 *) val of_iter : elt iter -> t (** Build a set from the given [iter] of elements. diff --git a/src/core/CCSet.mli b/src/core/CCSet.mli index 89c3f1acc..1afd7344f 100644 --- a/src/core/CCSet.mli +++ b/src/core/CCSet.mli @@ -43,7 +43,7 @@ module type S = sig val find_first_map : (elt -> 'a option) -> t -> 'a option (** [find_first_map f s] find the minimum element [x] of [s] such that [f x = Some y] and return [Some y]. Otherwise returns [None]. - @since NEXT_RELEASE *) + @since 3.12 *) val find_last : (elt -> bool) -> t -> elt (** Find maximum element satisfying predicate. @@ -56,7 +56,7 @@ module type S = sig val find_last_map : (elt -> 'a option) -> t -> 'a option (** [find_last_map f s] find the maximum element [x] of [s] such that [f x = Some y] and return [Some y]. Otherwise returns [None]. - @since NEXT_RELEASE *) + @since 3.12 *) val of_iter : elt iter -> t (** Build a set from the given [iter] of elements.