mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-05 19:00:31 -05:00
prepare for 3.5
This commit is contained in:
parent
30419a2ec7
commit
aa05f69471
12 changed files with 41 additions and 26 deletions
15
CHANGELOG.md
15
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`
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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. *)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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}. *)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue