mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
prepare for 2.2
This commit is contained in:
parent
ba87e105a0
commit
e825bf2916
6 changed files with 38 additions and 27 deletions
|
|
@ -1,5 +1,18 @@
|
||||||
= Changelog
|
= Changelog
|
||||||
|
|
||||||
|
== 2.2
|
||||||
|
|
||||||
|
- Improving comments presentation
|
||||||
|
- Add `CCOpt.return_if`
|
||||||
|
- Add `CCOpt.flatten`
|
||||||
|
- Add `CCString.{,r}drop_while`
|
||||||
|
- add many missing functions to `CCListLabels`
|
||||||
|
- test: consistency `CCList{,Labels}`
|
||||||
|
|
||||||
|
- fix(arrayLabels): compatibility with 4.07
|
||||||
|
- fix: compatibility for CCArrayLabels
|
||||||
|
- test: add compatibility checks between `CCArray{,Labels}`
|
||||||
|
|
||||||
== 2.1
|
== 2.1
|
||||||
|
|
||||||
- make `CCInt64` compatible with `Int64` (breaking!) (closes #192)
|
- make `CCInt64` compatible with `Int64` (breaking!) (closes #192)
|
||||||
|
|
|
||||||
|
|
@ -560,8 +560,6 @@ can be removed.
|
||||||
removed deprecated functions, etc.
|
removed deprecated functions, etc.
|
||||||
. update `CHANGELOG.adoc` (see its end to find the right git command)
|
. update `CHANGELOG.adoc` (see its end to find the right git command)
|
||||||
. commit the changes
|
. commit the changes
|
||||||
. `git checkout stable`
|
|
||||||
. `git merge master`
|
|
||||||
. `make test doc`
|
. `make test doc`
|
||||||
. tag, and push both to github
|
. tag, and push both to github
|
||||||
. `opam pin add containers https://github.com/c-cube/ocaml-containers.git#<release>`
|
. `opam pin add containers https://github.com/c-cube/ocaml-containers.git#<release>`
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
opam-version: "1.2"
|
opam-version: "1.2"
|
||||||
name: "containers"
|
name: "containers"
|
||||||
version: "2.1"
|
version: "2.2"
|
||||||
author: "Simon Cruanes"
|
author: "Simon Cruanes"
|
||||||
maintainer: "simon.cruanes.2007@m4x.org"
|
maintainer: "simon.cruanes.2007@m4x.org"
|
||||||
build: [
|
build: [
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ val fold_map : f:('acc -> 'a -> 'acc * 'b) -> init:'acc -> 'a list -> 'acc * 'b
|
||||||
@since 0.14 *)
|
@since 0.14 *)
|
||||||
|
|
||||||
val scan_left : f:('acc -> 'a -> 'acc) -> init:'acc -> 'a list -> 'acc list
|
val scan_left : f:('acc -> 'a -> 'acc) -> init:'acc -> 'a list -> 'acc list
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val fold_map2 : f:('acc -> 'a -> 'b -> 'acc * 'c) -> init:'acc -> 'a list -> 'b list -> 'acc * 'c list
|
val fold_map2 : f:('acc -> 'a -> 'b -> 'acc * 'c) -> init:'acc -> 'a list -> 'b list -> 'acc * 'c list
|
||||||
(** [fold_map2] is to [fold_map] what [List.map2] is to [List.map].
|
(** [fold_map2] is to [fold_map] what [List.map2] is to [List.map].
|
||||||
|
|
@ -84,7 +84,7 @@ val fold_flat_map : f:('acc -> 'a -> 'acc * 'b list) -> init:'acc -> 'a list ->
|
||||||
@since 0.14 *)
|
@since 0.14 *)
|
||||||
|
|
||||||
val count : f:('a -> bool) -> 'a list -> int
|
val count : f:('a -> bool) -> 'a list -> int
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val init : int -> f:(int -> 'a) -> 'a t
|
val init : int -> f:(int -> 'a) -> 'a t
|
||||||
(** [init len ~f] is [f 0; f 1; ...; f (len-1)].
|
(** [init len ~f] is [f 0; f 1; ...; f (len-1)].
|
||||||
|
|
@ -92,21 +92,21 @@ val init : int -> f:(int -> 'a) -> 'a t
|
||||||
@since 0.6 *)
|
@since 0.6 *)
|
||||||
|
|
||||||
val combine : 'a list -> 'b list -> ('a * 'b) list
|
val combine : 'a list -> 'b list -> ('a * 'b) list
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val combine_gen : 'a list -> 'b list -> ('a * 'b) gen
|
val combine_gen : 'a list -> 'b list -> ('a * 'b) gen
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val split : ('a * 'b) t -> 'a t * 'b t
|
val split : ('a * 'b) t -> 'a t * 'b t
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
|
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
|
||||||
|
|
||||||
val compare_lengths : 'a t -> 'b t -> int
|
val compare_lengths : 'a t -> 'b t -> int
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val compare_length_with : 'a t -> int -> int
|
val compare_length_with : 'a t -> int -> int
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
|
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
|
||||||
|
|
||||||
|
|
@ -123,10 +123,10 @@ val fold_product : f:('c -> 'a -> 'b -> 'c) -> init:'c -> 'a t -> 'b t -> 'c
|
||||||
(** Fold on the cartesian product. *)
|
(** Fold on the cartesian product. *)
|
||||||
|
|
||||||
val cartesian_product : 'a t t -> 'a t t
|
val cartesian_product : 'a t t -> 'a t t
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val map_product_l : f:('a -> 'b list) -> 'a list -> 'b list list
|
val map_product_l : f:('a -> 'b list) -> 'a list -> 'b list list
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
val diagonal : 'a t -> ('a * 'a) t
|
val diagonal : 'a t -> ('a * 'a) t
|
||||||
(** All pairs of distinct positions of the list. [list_diagonal l] will
|
(** All pairs of distinct positions of the list. [list_diagonal l] will
|
||||||
return the list of [List.nth i l, List.nth j l] if [i < j]. *)
|
return the list of [List.nth i l, List.nth j l] if [i < j]. *)
|
||||||
|
|
@ -155,12 +155,12 @@ val sublists_of_len :
|
||||||
|
|
||||||
val intersperse : x:'a -> 'a list -> 'a list
|
val intersperse : x:'a -> 'a list -> 'a list
|
||||||
(** Insert the first argument between every element of the list.
|
(** Insert the first argument between every element of the list.
|
||||||
@since NEXT_RELEASE *)
|
@since 2.2 *)
|
||||||
|
|
||||||
val interleave : 'a list -> 'a list -> 'a list
|
val interleave : 'a list -> 'a list -> 'a list
|
||||||
(** [interleave [x1…xn] [y1…ym]] is [x1,y1,x2,y2,…] and finishes with
|
(** [interleave [x1…xn] [y1…ym]] is [x1,y1,x2,y2,…] and finishes with
|
||||||
the suffix of the longest list.
|
the suffix of the longest list.
|
||||||
@since NEXT_RELEASE *)
|
@since 2.2 *)
|
||||||
|
|
||||||
val pure : 'a -> 'a t
|
val pure : 'a -> 'a t
|
||||||
(** [pure] is [return]. *)
|
(** [pure] is [return]. *)
|
||||||
|
|
@ -201,7 +201,7 @@ val drop_while : f:('a -> bool) -> 'a t -> 'a t
|
||||||
@since 0.13 *)
|
@since 0.13 *)
|
||||||
|
|
||||||
val take_drop_while : f:('a -> bool) -> 'a t -> 'a t * 'a t
|
val take_drop_while : f:('a -> bool) -> 'a t -> 'a t * 'a t
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val last : int -> 'a t -> 'a t
|
val last : int -> 'a t -> 'a t
|
||||||
(** [last n l] takes the last [n] elements of [l] (or less if
|
(** [last n l] takes the last [n] elements of [l] (or less if
|
||||||
|
|
@ -225,7 +225,7 @@ val find_pred : f:('a -> bool) -> 'a t -> 'a option
|
||||||
@since 0.11 *)
|
@since 0.11 *)
|
||||||
|
|
||||||
val find_opt : f:('a -> bool) -> 'a t -> 'a option
|
val find_opt : f:('a -> bool) -> 'a t -> 'a option
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val find_pred_exn : f:('a -> bool) -> 'a t -> 'a
|
val find_pred_exn : f:('a -> bool) -> 'a t -> 'a
|
||||||
(** Unsafe version of {!find_pred}.
|
(** Unsafe version of {!find_pred}.
|
||||||
|
|
@ -257,16 +257,16 @@ val filter_map : f:('a -> 'b option) -> 'a t -> 'b t
|
||||||
Map and remove elements at the same time. *)
|
Map and remove elements at the same time. *)
|
||||||
|
|
||||||
val keep_some : 'a option t -> 'a t
|
val keep_some : 'a option t -> 'a t
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val keep_ok : ('a, _) Result.result t -> 'a t
|
val keep_ok : ('a, _) Result.result t -> 'a t
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val all_some : 'a option t -> 'a t option
|
val all_some : 'a option t -> 'a t option
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val all_ok : ('a, 'err) Result.result t -> ('a t, 'err) Result.result
|
val all_ok : ('a, 'err) Result.result t -> ('a t, 'err) Result.result
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val sorted_merge : cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list
|
val sorted_merge : cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list
|
||||||
(** Merges elements from both sorted list. *)
|
(** Merges elements from both sorted list. *)
|
||||||
|
|
@ -316,13 +316,13 @@ val iteri : f:(int -> 'a -> unit) -> 'a t -> unit
|
||||||
itself as second argument. *)
|
itself as second argument. *)
|
||||||
|
|
||||||
val iteri2 : f:(int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit
|
val iteri2 : f:(int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val foldi : f:('b -> int -> 'a -> 'b) -> init:'b -> 'a t -> 'b
|
val foldi : f:('b -> int -> 'a -> 'b) -> init:'b -> 'a t -> 'b
|
||||||
(** Like [fold] but it also passes in the index of each element to the folded function. Tail-recursive. *)
|
(** Like [fold] but it also passes in the index of each element to the folded function. Tail-recursive. *)
|
||||||
|
|
||||||
val foldi2 : f:('c -> int -> 'a -> 'b -> 'c) -> init:'c -> 'a t -> 'b t -> 'c
|
val foldi2 : f:('c -> int -> 'a -> 'b -> 'c) -> init:'c -> 'a t -> 'b t -> 'c
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val get_at_idx : int -> 'a t -> 'a option
|
val get_at_idx : int -> 'a t -> 'a option
|
||||||
(** Get by index in the list.
|
(** Get by index in the list.
|
||||||
|
|
@ -330,7 +330,7 @@ val get_at_idx : int -> 'a t -> 'a option
|
||||||
of the list. *)
|
of the list. *)
|
||||||
|
|
||||||
val nth_opt : 'a t -> int -> 'a option
|
val nth_opt : 'a t -> int -> 'a option
|
||||||
(** @since NEXT_RELEASE *)
|
(** @since 2.2 *)
|
||||||
|
|
||||||
val get_at_idx_exn : int -> 'a t -> 'a
|
val get_at_idx_exn : int -> 'a t -> 'a
|
||||||
(** Get the i-th element, or
|
(** Get the i-th element, or
|
||||||
|
|
|
||||||
|
|
@ -124,13 +124,13 @@ val choice : 'a t list -> 'a t
|
||||||
|
|
||||||
val flatten : 'a t t -> 'a t
|
val flatten : 'a t t -> 'a t
|
||||||
(** [flatten] transforms [Some x] into [x].
|
(** [flatten] transforms [Some x] into [x].
|
||||||
@since NEXT_RELEASE *)
|
@since 2.2 *)
|
||||||
|
|
||||||
val return_if : bool -> 'a -> 'a t
|
val return_if : bool -> 'a -> 'a t
|
||||||
(** Apply [Some] or [None] depending on a boolean.
|
(** Apply [Some] or [None] depending on a boolean.
|
||||||
More precisely, [return_if false x] is [None],
|
More precisely, [return_if false x] is [None],
|
||||||
and [return_if true x] is [Some x].
|
and [return_if true x] is [Some x].
|
||||||
@since NEXT_RELEASE *)
|
@since 2.2 *)
|
||||||
|
|
||||||
(** {2 Infix Operators}
|
(** {2 Infix Operators}
|
||||||
@since 0.16 *)
|
@since 0.16 *)
|
||||||
|
|
|
||||||
|
|
@ -249,12 +249,12 @@ include S with type t := string
|
||||||
val drop_while : (char -> bool) -> t -> t
|
val drop_while : (char -> bool) -> t -> t
|
||||||
(** [drop_while f s] discards any characters starting from the left,
|
(** [drop_while f s] discards any characters starting from the left,
|
||||||
up to the first character [c] not satisfying [f c].
|
up to the first character [c] not satisfying [f c].
|
||||||
@since NEXT_RELEASE *)
|
@since 2.2 *)
|
||||||
|
|
||||||
val rdrop_while : (char -> bool) -> t -> t
|
val rdrop_while : (char -> bool) -> t -> t
|
||||||
(** [rdrop_while f s] discards any characters starting from the right,
|
(** [rdrop_while f s] discards any characters starting from the right,
|
||||||
up to the first character [c] not satisfying [f c].
|
up to the first character [c] not satisfying [f c].
|
||||||
@since NEXT_RELEASE *)
|
@since 2.2 *)
|
||||||
|
|
||||||
val ltrim : t -> t
|
val ltrim : t -> t
|
||||||
(** Trim space on the left (see {!String.trim} for more details).
|
(** Trim space on the left (see {!String.trim} for more details).
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue