Skip to content

Commit

Permalink
prepare for 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Dec 14, 2019
1 parent ab494fb commit 5126973
Show file tree
Hide file tree
Showing 32 changed files with 218 additions and 183 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## 2.8

### Breaking:

- bump minimum version of OCaml to 4.03, drop deps `{result,uchar}`
- deprecate `{of,to}_seq` a bit everywhere
- deprecate `CCKList` as it's subsumed by `Seq`

- feat: on `>= 4.08`, support let+ and let* operators
- feat(list): add indexed functions and `fold_on_map`
- refactor: also port `CCGraph` to iter
- feat: add `{to,of,add}_{iter,std_seq}` where relevant
- feat(unix): add `ensure_session_leader` and add some docs
- feat(pool): add infix operators on futures
- fix(pp): improve printing of hashtables
- feat: add `monoid_product` to Array and Vector
- improved gc behavior for `CCvector`
- deprecate `CCVector.fill_empty_slots_with`
- `CCVector.shrink_to_fit` to limit memory usage
- add `CCVector.clear_and_reset`
- feat(sexp): expose `parse_string_list` and the list decoder
- add `CCUnix.with_temp_dir` function
- deprecate `CCOpt.to_seq`, provide `to_iter` instead
- add `CCOpt.value` to improve compat with `Stdlib.Option`
- add `CCVector.mapi`

- fix: restore `CCSexp.atom` and `list` which was lost in 2.7
- fix(sexp): set location properly when parsing a file
- fix: properly alias to `CCChar` in containers.ml

- use older dune dialect
- remove unlabel, remove all traces of Result
- require dune configurator explicitly in opam
- Re-enable mdx tests
- fix benchs so they don't depend on clarity and they compile again

## 2.7

- deprecate CCKList in favor of the standard Seq
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ can be removed.
- `make update_next_tag` (to update `@since` comments; be careful not to change symlinks)
- check status of modules (`{b status: foo}`) and update if required;
removed deprecated functions, etc.
- `make unlabel` to see if labelled interfaces are up to date (requires compiler-libs)
- update `CHANGELOG.md` (see its end to find the right git command)
- commit the changes
- `make test doc`
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: "2.7"
version: "2.8"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
synopsis: "A modular, clean and powerful extension of the OCaml standard library"
Expand Down
12 changes: 6 additions & 6 deletions src/core/CCArray.mli
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type 'a sequence = ('a -> unit) -> unit

type 'a iter = ('a -> unit) -> unit
(** Fast internal iterator.
@since NEXT_RELEASE *)
@since 2.8 *)

type 'a klist = unit -> [`Nil | `Cons of 'a * 'a klist]
type 'a gen = unit -> 'a option
Expand Down Expand Up @@ -261,13 +261,13 @@ val to_iter : 'a t -> 'a iter
(** [to_iter a] returns an [iter] of the elements of an array [a].
The input array [a] is shared with the sequence and modification of it will result
in modification of the iterator.
@since NEXT_RELEASE *)
@since 2.8 *)

val to_std_seq : 'a t -> 'a Seq.t
(** [to_std_seq a] returns a [Seq.t] of the elements of an array [a].
The input array [a] is shared with the sequence and modification of it will result
in modification of the sequence.
@since NEXT_RELEASE
@since 2.8
*)

val to_seq : 'a t -> 'a sequence
Expand Down Expand Up @@ -323,7 +323,7 @@ val filter_map : ('a -> 'b option) -> 'a t -> 'b t

val monoid_product : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
(** All combinaisons of tuples from the two arrays are passed to the function
@since NEXT_RELEASE *)
@since 2.8 *)

val flat_map : ('a -> 'b t) -> 'a t -> 'b array
(** [flat_map f a] transforms each element of [a] into an array, then flattens. *)
Expand Down Expand Up @@ -401,10 +401,10 @@ module Infix : sig
@since 0.17 *)

(** Let operators on OCaml >= 4.08.0, nothing otherwise
@since NEXT_RELEASE *)
@since 2.8 *)
include CCShimsMkLet_.S with type 'a t_let := 'a array
end

(** Let operators on OCaml >= 4.08.0, nothing otherwise
@since NEXT_RELEASE *)
@since 2.8 *)
include CCShimsMkLet_.S with type 'a t_let := 'a array
12 changes: 6 additions & 6 deletions src/core/CCArrayLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type 'a sequence = ('a -> unit) -> unit

type 'a iter = ('a -> unit) -> unit
(** Fast internal iterator.
@since NEXT_RELEASE *)
@since 2.8 *)

type 'a klist = unit -> [`Nil | `Cons of 'a * 'a klist]
type 'a gen = unit -> 'a option
Expand Down Expand Up @@ -261,13 +261,13 @@ val to_iter : 'a t -> 'a iter
(** [to_iter a] returns an [iter] of the elements of an array [a].
The input array [a] is shared with the sequence and modification of it will result
in modification of the iterator.
@since NEXT_RELEASE *)
@since 2.8 *)

val to_std_seq : 'a t -> 'a Seq.t
(** [to_std_seq a] returns a [Seq.t] of the elements of an array [a].
The input array [a] is shared with the sequence and modification of it will result
in modification of the sequence.
@since NEXT_RELEASE
@since 2.8
*)

val to_seq : 'a t -> 'a sequence
Expand Down Expand Up @@ -323,7 +323,7 @@ val filter_map : f:('a -> 'b option) -> 'a t -> 'b t

val monoid_product : f:('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
(** All combinaisons of tuples from the two arrays are passed to the function
@since NEXT_RELEASE *)
@since 2.8 *)

val flat_map : f:('a -> 'b t) -> 'a t -> 'b array
(** [flat_map ~f a] transforms each element of [a] into an array, then flattens. *)
Expand Down Expand Up @@ -401,10 +401,10 @@ module Infix : sig
@since 0.17 *)

(** Let operators on OCaml >= 4.08.0, nothing otherwise
@since NEXT_RELEASE *)
@since 2.8 *)
include CCShimsMkLet_.S with type 'a t_let := 'a array
end

(** Let operators on OCaml >= 4.08.0, nothing otherwise
@since NEXT_RELEASE *)
@since 2.8 *)
include CCShimsMkLet_.S with type 'a t_let := 'a array
6 changes: 3 additions & 3 deletions src/core/CCArray_slice.mli
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type 'a sequence = ('a -> unit) -> unit

type 'a iter = ('a -> unit) -> unit
(** Fast internal iterator.
@since NEXT_RELEASE *)
@since 2.8 *)

type 'a klist = unit -> [`Nil | `Cons of 'a * 'a klist]
type 'a gen = unit -> 'a option
Expand Down Expand Up @@ -249,13 +249,13 @@ val to_iter : 'a t -> 'a iter
(** [to_iter a] returns an [iter] of the elements of a slice [a].
The input array [a] is shared with the sequence and modification of it will result
in modification of the iterator.
@since NEXT_RELEASE *)
@since 2.8 *)

val to_std_seq : 'a t -> 'a Seq.t
(** [to_std_seq a] returns a [Seq.t] of the elements of a slice [a].
The input array [a] is shared with the sequence and modification of it will result
in modification of the sequence.
@since NEXT_RELEASE
@since 2.8
*)

val to_seq : 'a t -> 'a sequence
Expand Down
6 changes: 3 additions & 3 deletions src/core/CCArray_sliceLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type 'a sequence = ('a -> unit) -> unit

type 'a iter = ('a -> unit) -> unit
(** Fast internal iterator.
@since NEXT_RELEASE *)
@since 2.8 *)

type 'a klist = unit -> [`Nil | `Cons of 'a * 'a klist]
type 'a gen = unit -> 'a option
Expand Down Expand Up @@ -246,13 +246,13 @@ val to_iter : 'a t -> 'a iter
(** [to_iter a] returns an [iter] of the elements of a slice [a].
The input array [a] is shared with the sequence and modification of it will result
in modification of the iterator.
@since NEXT_RELEASE *)
@since 2.8 *)

val to_std_seq : 'a t -> 'a Seq.t
(** [to_std_seq a] returns a [Seq.t] of the elements of a slice [a].
The input array [a] is shared with the sequence and modification of it will result
in modification of the sequence.
@since NEXT_RELEASE
@since 2.8
*)

val to_seq : 'a t -> 'a sequence
Expand Down
18 changes: 9 additions & 9 deletions src/core/CCHashtbl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ module type S = sig

val to_iter : 'a t -> (key * 'a) iter
(** Iterate on bindings in the table.
@since NEXT_RELEASE *)
@since 2.8 *)

val to_seq : 'a t -> (key * 'a) sequence
(** Iterate on values in the table.
Expand All @@ -220,11 +220,11 @@ module type S = sig

val add_iter : 'a t -> (key * 'a) iter -> unit
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
@since NEXT_RELEASE *)
@since 2.8 *)

val add_std_seq : 'a t -> (key * 'a) Seq.t -> unit
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
@since NEXT_RELEASE *)
@since 2.8 *)

val add_seq : 'a t -> (key * 'a) sequence -> unit
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
Expand All @@ -234,11 +234,11 @@ module type S = sig

val of_iter : (key * 'a) iter -> 'a t
(** From the given bindings, added in order.
@since NEXT_RELEASE *)
@since 2.8 *)

val of_std_seq : (key * 'a) Seq.t -> 'a t
(** From the given bindings, added in order.
@since NEXT_RELEASE *)
@since 2.8 *)

val of_seq : (key * 'a) sequence -> 'a t
(** From the given bindings, added in order.
Expand All @@ -249,13 +249,13 @@ module type S = sig
(** [add_iter_count tbl i] increments the count of each element of [i]
by calling {!incr}. This is useful for counting how many times each
element of [i] occurs.
@since NEXT_RELEASE *)
@since 2.8 *)

val add_std_seq_count : int t -> key Seq.t -> unit
(** [add_seq_count tbl seq] increments the count of each element of [seq]
by calling {!incr}. This is useful for counting how many times each
element of [seq] occurs.
@since NEXT_RELEASE *)
@since 2.8 *)

val add_seq_count : int t -> key sequence -> unit
(** [add_seq_count tbl seq] increments the count of each element of [seq]
Expand All @@ -267,11 +267,11 @@ module type S = sig

val of_iter_count : key iter -> int t
(** Like {!add_seq_count}, but allocates a new table and returns it.
@since NEXT_RELEASE *)
@since 2.8 *)

val of_std_seq_count : key Seq.t -> int t
(** Like {!add_seq_count}, but allocates a new table and returns it.
@since NEXT_RELEASE *)
@since 2.8 *)

val of_seq_count : key sequence -> int t
(** Like {!add_seq_count}, but allocates a new table and returns it.
Expand Down
Loading

0 comments on commit 5126973

Please sign in to comment.