Skip to content

Commit

Permalink
prepare for 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed May 11, 2018
1 parent ba87e10 commit e825bf2
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 27 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
= 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

- make `CCInt64` compatible with `Int64` (breaking!) (closes #192)
Expand Down
2 changes: 0 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,6 @@ can be removed.
removed deprecated functions, etc.
. update `CHANGELOG.adoc` (see its end to find the right git command)
. commit the changes
. `git checkout stable`
. `git merge master`
. `make test doc`
. tag, and push both to github
. `opam pin add containers https://github.com/c-cube/ocaml-containers.git#<release>`
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: "1.2"
name: "containers"
version: "2.1"
version: "2.2"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
build: [
Expand Down
40 changes: 20 additions & 20 deletions src/core/CCListLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ val fold_map : f:('acc -> 'a -> 'acc * 'b) -> init:'acc -> 'a list -> 'acc * 'b
@since 0.14 *)

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
(** [fold_map2] is to [fold_map] what [List.map2] is to [List.map].
Expand All @@ -84,29 +84,29 @@ val fold_flat_map : f:('acc -> 'a -> 'acc * 'b list) -> init:'acc -> 'a list ->
@since 0.14 *)

val count : f:('a -> bool) -> 'a list -> int
(** @since NEXT_RELEASE *)
(** @since 2.2 *)

val init : int -> f:(int -> 'a) -> 'a t
(** [init len ~f] is [f 0; f 1; ...; f (len-1)].
@raise Invalid_argument if len < 0.
@since 0.6 *)

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
(** @since NEXT_RELEASE *)
(** @since 2.2 *)

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_lengths : 'a t -> 'b t -> int
(** @since NEXT_RELEASE *)
(** @since 2.2 *)

val compare_length_with : 'a t -> int -> int
(** @since NEXT_RELEASE *)
(** @since 2.2 *)

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

Expand All @@ -123,10 +123,10 @@ val fold_product : f:('c -> 'a -> 'b -> 'c) -> init:'c -> 'a t -> 'b t -> 'c
(** Fold on the cartesian product. *)

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
(** @since NEXT_RELEASE *)
(** @since 2.2 *)
val diagonal : 'a t -> ('a * 'a) t
(** 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]. *)
Expand Down Expand Up @@ -155,12 +155,12 @@ val sublists_of_len :

val intersperse : x:'a -> 'a list -> 'a 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
(** [interleave [x1…xn] [y1…ym]] is [x1,y1,x2,y2,…] and finishes with
the suffix of the longest list.
@since NEXT_RELEASE *)
@since 2.2 *)

val pure : 'a -> 'a t
(** [pure] is [return]. *)
Expand Down Expand Up @@ -201,7 +201,7 @@ val drop_while : f:('a -> bool) -> 'a t -> 'a t
@since 0.13 *)

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
(** [last n l] takes the last [n] elements of [l] (or less if
Expand All @@ -225,7 +225,7 @@ val find_pred : f:('a -> bool) -> 'a t -> 'a option
@since 0.11 *)

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
(** Unsafe version of {!find_pred}.
Expand Down Expand Up @@ -257,16 +257,16 @@ val filter_map : f:('a -> 'b option) -> 'a t -> 'b t
Map and remove elements at the same time. *)

val keep_some : 'a option t -> 'a t
(** @since NEXT_RELEASE *)
(** @since 2.2 *)

val keep_ok : ('a, _) Result.result t -> 'a t
(** @since NEXT_RELEASE *)
(** @since 2.2 *)

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
(** @since NEXT_RELEASE *)
(** @since 2.2 *)

val sorted_merge : cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list
(** Merges elements from both sorted list. *)
Expand Down Expand Up @@ -316,21 +316,21 @@ val iteri : f:(int -> 'a -> unit) -> 'a t -> unit
itself as second argument. *)

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
(** 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
(** @since NEXT_RELEASE *)
(** @since 2.2 *)

val get_at_idx : int -> 'a t -> 'a option
(** Get by index in the list.
If the index is negative, it will get element starting from the end
of the list. *)

val nth_opt : 'a t -> int -> 'a option
(** @since NEXT_RELEASE *)
(** @since 2.2 *)

val get_at_idx_exn : int -> 'a t -> 'a
(** Get the i-th element, or
Expand Down
4 changes: 2 additions & 2 deletions src/core/CCOpt.mli
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ val choice : 'a t list -> 'a t

val flatten : 'a t t -> 'a t
(** [flatten] transforms [Some x] into [x].
@since NEXT_RELEASE *)
@since 2.2 *)

val return_if : bool -> 'a -> 'a t
(** Apply [Some] or [None] depending on a boolean.
More precisely, [return_if false x] is [None],
and [return_if true x] is [Some x].
@since NEXT_RELEASE *)
@since 2.2 *)

(** {2 Infix Operators}
@since 0.16 *)
Expand Down
4 changes: 2 additions & 2 deletions src/core/CCString.mli
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ include S with type t := string
val drop_while : (char -> bool) -> t -> t
(** [drop_while f s] discards any characters starting from the left,
up to the first character [c] not satisfying [f c].
@since NEXT_RELEASE *)
@since 2.2 *)

val rdrop_while : (char -> bool) -> t -> t
(** [rdrop_while f s] discards any characters starting from the right,
up to the first character [c] not satisfying [f c].
@since NEXT_RELEASE *)
@since 2.2 *)

val ltrim : t -> t
(** Trim space on the left (see {!String.trim} for more details).
Expand Down

0 comments on commit e825bf2

Please sign in to comment.