Skip to content

Commit

Permalink
prepare for 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Aug 4, 2021
1 parent 30419a2 commit aa05f69
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 26 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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`
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.4"
version: "3.5"
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.4"
version: "3.5"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
license: "BSD-2"
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.4"
version: "3.5"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
license: "BSD-2"
Expand Down
6 changes: 3 additions & 3 deletions src/core/CCFormat.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/core/CCHash.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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. *)
Expand Down
8 changes: 4 additions & 4 deletions src/core/CCIO.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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. *)
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions src/core/CCList.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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).
Expand All @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions src/core/CCListLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]
Expand All @@ -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).
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/core/CCOpt.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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}. *)
Expand Down
6 changes: 3 additions & 3 deletions src/core/CCUtf8_string.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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. *)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/data/CCBV.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit aa05f69

Please sign in to comment.