diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c2d6d612..d97d3d9ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 3.5 + +- add `CCHash.map` and `CCHash.bytes` +- CCIO: add many `Seq.t` based functions +- CCUtf8string: add `{make,empty,of_uchar}` +- add `CCFormat.{const_string,opaque}` +- add `CCOpt.{some,none}` +- CCFormat: expose `ANSI_codes` module +- CCBV: add `equal`, refactor for performance and readability +- CCList: add `{sorted_diff_uniq,sorted_mem,sorted_diff,sorted_remove}` + +- fix(bv): index error in union +- test: add some property tests on `Csexp/Canonical_sexp` +- bv: add more tests, including regression for #370 + ## 3.4 - Add `CCOpt.get_exn_or` and deprecate `CCOpt.get_exn` diff --git a/containers-data.opam b/containers-data.opam index 281a00e6f..4ba3e1cc0 100644 --- a/containers-data.opam +++ b/containers-data.opam @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "3.4" +version: "3.5" 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 d0d4baab5..f721b89c7 100644 --- a/containers-thread.opam +++ b/containers-thread.opam @@ -1,5 +1,5 @@ opam-version: "2.0" -version: "3.4" +version: "3.5" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" license: "BSD-2" diff --git a/containers.opam b/containers.opam index e9d50fae2..f4bb3a162 100644 --- a/containers.opam +++ b/containers.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "containers" -version: "3.4" +version: "3.5" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" license: "BSD-2" diff --git a/src/core/CCFormat.mli b/src/core/CCFormat.mli index 0be0cdd85..aedbcbfae 100644 --- a/src/core/CCFormat.mli +++ b/src/core/CCFormat.mli @@ -170,12 +170,12 @@ val some : 'a printer -> 'a option printer val const_string : string -> 'a printer (** [const_string s] is a printer that ignores its input and always prints [s]. - @since NEXT_RELEASE *) + @since 3.5 *) val opaque : 'a printer (** [opaque] is [const_string "opaque"]. The exact string used is not stable. - @since NEXT_RELEASE *) + @since 3.5 *) val lazy_force : 'a printer -> 'a lazy_t printer (** [lazy_force pp out x] forces [x] and prints the result with [pp]. @@ -275,7 +275,7 @@ val with_color_ksf : f:(string -> 'b) -> string -> ('a, t, unit, 'b) format4 -> (** ANSI escape codes. This contains lower level functions for them. - @since NEXT_RELEASE *) + @since 3.5 *) module ANSI_codes : sig type color = [ `Black diff --git a/src/core/CCHash.mli b/src/core/CCHash.mli index 65e800d41..884f11a89 100644 --- a/src/core/CCHash.mli +++ b/src/core/CCHash.mli @@ -39,7 +39,7 @@ val slice : string -> int -> int t val bytes : bytes t (** Hash a byte array. - @since NEXT_RELEASE *) + @since 3.5 *) val string : string t @@ -61,7 +61,7 @@ val map : ('a -> 'b) -> 'b t -> 'a t let hash_str_set : Str_set.t CCHash.t = CCHash.(map Str_set.to_seq @@ seq string) ]} - @since NEXT_RELEASE *) + @since 3.5 *) val if_ : bool -> 'a t -> 'a t -> 'a t (** Decide which hash function to use depending on the boolean. *) diff --git a/src/core/CCIO.mli b/src/core/CCIO.mli index 4cb58707e..4b2f9eafe 100644 --- a/src/core/CCIO.mli +++ b/src/core/CCIO.mli @@ -75,7 +75,7 @@ val read_chunks_seq : ?size:int -> in_channel -> string Seq.t (** Read the channel's content into chunks of size [size]. {b NOTE} the generator must be used within the lifetime of the channel, see warning at the top of the file. - @since NEXT_RELEASE *) + @since 3.5 *) val read_line : in_channel -> string option (** Read a line from the channel. Returns [None] if the input is terminated. @@ -90,7 +90,7 @@ val read_lines_seq : in_channel -> string Seq.t (** Read all lines. {b NOTE} the seq must be used within the lifetime of the channel, see warning at the top of the file. - @since NEXT_RELEASE *) + @since 3.5 *) val read_lines_l : in_channel -> string list (** Read all lines into a list. *) @@ -130,14 +130,14 @@ val write_gen : ?sep:string -> out_channel -> string gen -> unit val write_seq : ?sep:string -> out_channel -> string Seq.t -> unit (** Write the given strings on the output. If provided, add [sep] between every two strings (but not at the end). - @since NEXT_RELEASE *) + @since 3.5 *) val write_lines : out_channel -> string gen -> unit (** Write every string on the output, followed by "\n". *) val write_lines_seq : out_channel -> string Seq.t -> unit (** Write every string on the output, followed by "\n". - @since NEXT_RELEASE *) + @since 3.5 *) val write_lines_l : out_channel -> string list -> unit diff --git a/src/core/CCList.mli b/src/core/CCList.mli index b24b5a78d..7c4b51614 100644 --- a/src/core/CCList.mli +++ b/src/core/CCList.mli @@ -500,7 +500,7 @@ val all_ok : ('a, 'err) result t -> ('a t, 'err) result val sorted_mem : cmp:('a -> 'a -> int) -> 'a -> 'a list -> bool (** [sorted_mem ~cmp x l] and [mem x l] give the same result for any sorted list [l], but potentially more efficiently. - @since NEXT_RELEASE *) + @since 3.5 *) val sorted_merge : cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list (** [sorted_merge ~cmp l1 l2] merges elements from both sorted list using @@ -514,7 +514,7 @@ val sorted_diff : cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list It is the left inverse of [sorted_merge]; that is, [sorted_diff ~cmp (sorted_merge ~cmp l1 l2) l2] is always equal to [l1] for sorted lists [l1] and [l2]. - @since NEXT_RELEASE *) + @since 3.5 *) val sort_uniq : cmp:('a -> 'a -> int) -> 'a list -> 'a list (** [sort_uniq ~cmp l] sorts the list [l] using the given comparison function [cmp] @@ -533,7 +533,7 @@ val sorted_diff_uniq : cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list for example, [sorted_diff_uniq ~cmp [1;1;1;2;2] [1;2;2;2]] would be [[1]]. [sorted_diff_uniq ~cmp l1 l2] and [uniq_succ ~eq (sorted_diff ~cmp l1 l2)] always give the same result for sorted [l1] and [l2] and compatible [cmp] and [eq]. - @since NEXT_RELEASE *) + @since 3.5 *) val is_sorted : cmp:('a -> 'a -> int) -> 'a list -> bool (** [is_sorted ~cmp l] returns [true] iff [l] is sorted (according to given order). @@ -554,7 +554,7 @@ val sorted_remove : cmp:('a -> 'a -> int) -> ?all:bool -> 'a -> 'a list -> 'a li is equal to [l] for any sorted list [l]. @param all if true then all occurrences of [x] will be removed. Otherwise, only the first [x] will be removed (if any). Default [false] (only the first will be removed). - @since NEXT_RELEASE *) + @since 3.5 *) val uniq_succ : eq:('a -> 'a -> bool) -> 'a list -> 'a list (** [uniq_succ ~eq l] removes duplicate elements that occur one next to the other. diff --git a/src/core/CCListLabels.mli b/src/core/CCListLabels.mli index bca4d062b..094eff9a2 100644 --- a/src/core/CCListLabels.mli +++ b/src/core/CCListLabels.mli @@ -503,7 +503,7 @@ val all_ok : ('a, 'err) result t -> ('a t, 'err) result val sorted_mem : cmp:(('a -> 'a -> int) [@keep_label]) -> 'a -> 'a list -> bool (** [sorted_mem ~cmp x l] and [mem x l] give the same result for any sorted list [l], but potentially more efficiently. - @since NEXT_RELEASE *) + @since 3.5 *) val sorted_merge : cmp:(('a -> 'a -> int) [@keep_label]) -> 'a list -> 'a list -> 'a list (** [sorted_merge ~cmp l1 l2] merges elements from both sorted list using @@ -517,7 +517,7 @@ val sorted_diff : cmp:(('a -> 'a -> int) [@keep_label]) -> 'a list -> 'a list -> It is the left inverse of [sorted_merge]; that is, [sorted_diff ~cmp (sorted_merge ~cmp l1 l2) l2] is always equal to [l1] for sorted lists [l1] and [l2]. - @since NEXT_RELEASE *) + @since 3.5 *) val sort_uniq : cmp:(('a -> 'a -> int) [@keep_label]) -> 'a list -> 'a list (** [sort_uniq ~cmp l] sorts the list [l] using the given comparison function [cmp] @@ -536,7 +536,7 @@ val sorted_diff_uniq : cmp:(('a -> 'a -> int) [@keep_label]) -> 'a list -> 'a li for example, [sorted_diff_uniq ~cmp [1;1;1;2;2] [1;2;2;2]] would be [[1]]. [sorted_diff_uniq ~cmp l1 l2] and [uniq_succ ~eq (sorted_diff ~cmp l1 l2)] always give the same result for sorted [l1] and [l2] and compatible [cmp] and [eq]. - @since NEXT_RELEASE *) + @since 3.5 *) val is_sorted : cmp:(('a -> 'a -> int) [@keep_label]) -> 'a list -> bool (** [is_sorted ~cmp l] returns [true] iff [l] is sorted (according to given order). @@ -557,7 +557,7 @@ val sorted_remove : cmp:(('a -> 'a -> int) [@keep_label]) -> ?all:bool -> 'a -> is equal to [l] for any sorted list [l]. @param all if true then all occurrences of [x] will be removed. Otherwise, only the first [x] will be removed (if any). Default [false] (only the first will be removed). - @since NEXT_RELEASE *) + @since 3.5 *) val uniq_succ : eq:(('a -> 'a -> bool) [@keep_label]) -> 'a list -> 'a list (** [uniq_succ ~eq l] removes duplicate elements that occur one next to the other. diff --git a/src/core/CCOpt.mli b/src/core/CCOpt.mli index 39a3597a9..7b596e39a 100644 --- a/src/core/CCOpt.mli +++ b/src/core/CCOpt.mli @@ -36,11 +36,11 @@ val return : 'a -> 'a t val some : 'a -> 'a t (** Alias to {!return}. - @since NEXT_RELEASE *) + @since 3.5 *) val none : 'a t (** Alias to {!None}. - @since NEXT_RELEASE *) + @since 3.5 *) val (>|=) : 'a t -> ('a -> 'b) -> 'b t (** [o >|= f] is the infix version of {!map}. *) diff --git a/src/core/CCUtf8_string.mli b/src/core/CCUtf8_string.mli index fc12ec560..068cef7ed 100644 --- a/src/core/CCUtf8_string.mli +++ b/src/core/CCUtf8_string.mli @@ -79,7 +79,7 @@ val flat_map : (uchar -> t) -> t -> t val empty : t (** Empty string. - @since NEXT_RELEASE *) + @since 3.5 *) val append : t -> t -> t (** Append two string together. *) @@ -90,11 +90,11 @@ val concat : t -> t list -> t val of_uchar : uchar -> t (** [of_char c] is a string with only one unicode char in it. - @since NEXT_RELEASE *) + @since 3.5 *) val make : int -> uchar -> t (** [make n c] makes a new string with [n] copies of [c] in it. - @since NEXT_RELEASE *) + @since 3.5 *) val of_seq : uchar Seq.t -> t (** Build a string from unicode codepoints diff --git a/src/data/CCBV.mli b/src/data/CCBV.mli index 7829c6ad0..052775282 100644 --- a/src/data/CCBV.mli +++ b/src/data/CCBV.mli @@ -138,7 +138,7 @@ val selecti : t -> 'a array -> ('a * int) list val equal : t -> t -> bool (** Bitwise comparison, including the size ([equal a b] implies [length a=length b]). - @since NEXT_RELEASE *) + @since 3.5 *) type 'a iter = ('a -> unit) -> unit