Skip to content

Commit

Permalink
prepare for 3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Apr 2, 2021
1 parent 13028c3 commit 739dd44
Show file tree
Hide file tree
Showing 18 changed files with 80 additions and 51 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## 3.3

- feat: add code-generator for optimal bitfields; add tests
- new Canonical sexpr module with printer and parser

- CCSeq: Add `for_all` and `exists`
- feat(sexp): expose last location in decoder
- feat(CCChar): add CCChar.Infix
- feat(CCString): add CCString.foldi
- feat(CCFormat): add `string_lines` combinator
- feat(CCList): update with regards to `partition_map`
- add `CCList.cons'`
- implement {of,add}_*_with family of function in `CCMap` with update (#352)
- add `CCMap.of_{list,iter,seq}_with` functions
- add `CCHashtbl.{of,add}_{list,seq,iter}_with`

- Fix integer overflow warning on jsoo (#346)
- updated fuzzer scripts

### Containers-thread

- refactor(pool): less locking, fix deadlock, more parallelism
- feat(pool): keep one idle thread
- small optim in `Pool.sequence_a`

## 3.2

- add CCEither module
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ map =
- : string option = Some "33"
```

### New types: `CCVector`, `CCHeap`, `CCResult`
### New types: `CCVector`, `CCHeap`, `CCResult`, `CCSexp`

Containers also contains (!) a few datatypes that are not from the standard
library but that are useful in a lot of situations:
Expand All @@ -454,6 +454,10 @@ library but that are useful in a lot of situations:
It uses the new `result` type from the standard library (or from
the retrocompatibility package on opam) and provides
many combinators for dealing with `result`.
- `CCSexp` and `CCCanonical_sexp`:
functorized printer and parser for S-expressions, respectively as
actual S-expressions (like `sexplib`) and as canonical binary-safe
S-expressions (like `csexp`)

Now for a few examples:

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.2"
version: "3.3"
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.2"
version: "3.3"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
synopsis: "An extension of containers for threading"
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.2"
version: "3.3"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
synopsis: "A modular, clean and powerful extension of the OCaml standard library"
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCCanonical_sexp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
See {{: https://en.wikipedia.org/wiki/Canonical_S-expressions} wikipedia}.
These S-expressions are binary safe.
@since NEXT_RELEASE
@since 3.3
*)

type 'a or_error = ('a, string) result
Expand Down
14 changes: 7 additions & 7 deletions src/core/CCChar.mli
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,26 @@ val pp : Format.formatter -> t -> unit

(** {2 Infix Operators}
@since NEXT_RELEASE *)
@since 3.3 *)

module Infix : sig
val (=) : t -> t -> bool
(** @since NEXT_RELEASE *)
(** @since 3.3 *)

val (<>) : t -> t -> bool
(** @since NEXT_RELEASE *)
(** @since 3.3 *)

val (<) : t -> t -> bool
(** @since NEXT_RELEASE *)
(** @since 3.3 *)

val (>) : t -> t -> bool
(** @since NEXT_RELEASE *)
(** @since 3.3 *)

val (<=) : t -> t -> bool
(** @since NEXT_RELEASE *)
(** @since 3.3 *)

val (>=) : t -> t -> bool
(** @since NEXT_RELEASE *)
(** @since 3.3 *)
end

include module type of Infix
2 changes: 1 addition & 1 deletion src/core/CCFormat.mli
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ val string_lines : string printer
place of spaces, unlike {!text}.
This means an already formatted string can be displayed inside another
formatter without mangling the indentation.
@since NEXT_RELEASE *)
@since 3.3 *)

val char : char printer (** @since 0.14 *)

Expand Down
10 changes: 5 additions & 5 deletions src/core/CCHashtbl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ module type S = sig
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val add_seq : 'a t -> (key * 'a) Seq.t -> unit
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
Expand All @@ -249,7 +249,7 @@ module type S = sig
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val of_iter : (key * 'a) iter -> 'a t
(** From the given bindings, added in order.
Expand All @@ -261,7 +261,7 @@ module type S = sig
(** From the given bindings, added in order.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val of_seq : (key * 'a) Seq.t -> 'a t
(** From the given bindings, added in order.
Expand All @@ -274,7 +274,7 @@ module type S = sig
(** From the given bindings, added in order.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val add_iter_count : int t -> key iter -> unit
(** [add_iter_count tbl i] increments the count of each element of [i]
Expand Down Expand Up @@ -313,7 +313,7 @@ module type S = sig
(** [of_list l] builds a table from the given list [l] of bindings [k_i -> v_i].
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val update : 'a t -> f:(key -> 'a option -> 'a option) -> k:key -> unit
(** [update tbl ~f ~k] updates key [k] by calling [f k (Some v)] if
Expand Down
20 changes: 10 additions & 10 deletions src/core/CCHashtbl.mli
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module Poly : sig
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val add_seq : ('a,'b) Hashtbl.t -> ('a * 'b) Seq.t -> unit
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
Expand All @@ -91,7 +91,7 @@ module Poly : sig
(** Add the corresponding pairs to the table.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val of_iter : ('a * 'b) iter -> ('a,'b) Hashtbl.t
(** From the given bindings, added in order.
Expand All @@ -103,7 +103,7 @@ module Poly : sig
(** From the given bindings, added in order.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val of_seq : ('a * 'b) Seq.t -> ('a,'b) Hashtbl.t
(** From the given bindings, added in order.
Expand All @@ -116,7 +116,7 @@ module Poly : sig
(** From the given bindings, added in order.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val add_iter_count : ('a, int) Hashtbl.t -> 'a iter -> unit
(** [add_iter_count tbl i] increments the count of each element of [i]
Expand Down Expand Up @@ -155,7 +155,7 @@ module Poly : sig
(** From the given bindings, added in order.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val update : ('a, 'b) Hashtbl.t -> f:('a -> 'b option -> 'b option) -> k:'a -> unit
(** [update tbl ~f ~k] updates key [k] by calling [f k (Some v)] if
Expand Down Expand Up @@ -251,7 +251,7 @@ module type S = sig
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val add_seq : 'a t -> (key * 'a) Seq.t -> unit
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
Expand All @@ -264,7 +264,7 @@ module type S = sig
(** Add the corresponding pairs to the table, using {!Hashtbl.add}.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val of_iter : (key * 'a) iter -> 'a t
(** From the given bindings, added in order.
Expand All @@ -276,7 +276,7 @@ module type S = sig
(** From the given bindings, added in order.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val of_seq : (key * 'a) Seq.t -> 'a t
(** From the given bindings, added in order.
Expand All @@ -289,7 +289,7 @@ module type S = sig
(** From the given bindings, added in order.
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val add_iter_count : int t -> key iter -> unit
(** [add_iter_count tbl i] increments the count of each element of [i]
Expand Down Expand Up @@ -328,7 +328,7 @@ module type S = sig
(** [of_list l] builds a table from the given list [l] of bindings [k_i -> v_i].
If a key occurs multiple times in the input, the values are combined
using [f] in an unspecified order.
@since NEXT_RELEASE *)
@since 3.3 *)

val update : 'a t -> f:(key -> 'a option -> 'a option) -> k:key -> unit
(** [update tbl ~f ~k] updates key [k] by calling [f k (Some v)] if
Expand Down
4 changes: 2 additions & 2 deletions src/core/CCList.mli
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ val cons_maybe : 'a option -> 'a t -> 'a t
val cons' : 'a t -> 'a -> 'a t
(** [cons' l x] is the same as [x :: l]. This is convenient for fold
functions such as {!List.fold_left} or {!Array.fold_left}.
@since NEXT_RELEASE *)
@since 3.3 *)

val (@) : 'a t -> 'a t -> 'a t
(** [l1 @ l2] is like [append l1 l2].
Expand Down Expand Up @@ -236,7 +236,7 @@ val partition_map_either : ('a -> ('b, 'c) CCEither.t) ->
(** [partition_map_either f l] maps [f] on [l] and gather results in lists:
- if [f x = Left y], adds [y] to the first list.
- if [f x = Right z], adds [z] to the second list.
@since NEXT_RELEASE *)
@since 3.3 *)

val partition_filter_map : ('a -> [<`Left of 'b | `Right of 'c | `Drop]) ->
'a list -> 'b list * 'c list
Expand Down
4 changes: 2 additions & 2 deletions src/core/CCListLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ val append : 'a t -> 'a t -> 'a t
val cons' : 'a t -> 'a -> 'a t
(** [cons' l x] is the same as [x :: l]. This is convenient for fold
functions such as {!List.fold_left} or {!Array.fold_left}.
@since NEXT_RELEASE *)
@since 3.3 *)

val cons_maybe : 'a option -> 'a t -> 'a t
(** [cons_maybe (Some x) l] is [x :: l].
Expand Down Expand Up @@ -240,7 +240,7 @@ val partition_map_either : f:('a -> ('b, 'c) CCEither.t) ->
(** [partition_map_either ~f l] maps [f] on [l] and gather results in lists:
- if [f x = Left y], adds [y] to the first list.
- if [f x = Right z], adds [z] to the second list.
@since NEXT_RELEASE *)
@since 3.3 *)

val partition_filter_map : f:('a -> [<`Left of 'b | `Right of 'c | `Drop]) ->
'a list -> 'b list * 'c list
Expand Down
12 changes: 6 additions & 6 deletions src/core/CCMap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module type S = sig
val add_seq_with : f:(key -> 'a -> 'a -> 'a) -> 'a t -> (key * 'a) Seq.t -> 'a t
(** [add_seq ~f m l] adds the given seq [l] of bindings to the map [m],
using [f] to combine values that have the same key.
@since NEXT_RELEASE *)
@since 3.3 *)

val of_seq : (key * 'a) Seq.t -> 'a t
(** [of_seq seq] builds a map from the given [Seq.t] of bindings.
Expand All @@ -91,7 +91,7 @@ module type S = sig
If a key occurs several times, all its bindings are combined using the
function [f], with [f key v1 v2] being called with [v1] occurring
later in the seq than [v2].
@since NEXT_RELEASE *)
@since 3.3 *)

val add_iter : 'a t -> (key * 'a) iter -> 'a t
(** [add_iter m iter] adds the given [iter] of bindings to the map [m].
Expand All @@ -101,7 +101,7 @@ module type S = sig
val add_iter_with : f:(key -> 'a -> 'a -> 'a) -> 'a t -> (key * 'a) iter -> 'a t
(** [add_iter ~f m l] adds the given iter [l] of bindings to the map [m],
using [f] to combine values that have the same key.
@since NEXT_RELEASE *)
@since 3.3 *)

val of_iter : (key * 'a) iter -> 'a t
(** [of_iter iter] builds a map from the given [iter] of bindings.
Expand All @@ -114,7 +114,7 @@ module type S = sig
If a key occurs several times, all its bindings are combined using the
function [f], with [f key v1 v2] being called with [v1] occurring
later in the iter than [v2].
@since NEXT_RELEASE *)
@since 3.3 *)

val to_iter : 'a t -> (key * 'a) iter
(** [to_iter m] iterates on the whole map [m], creating an [iter] of bindings.
Expand All @@ -133,7 +133,7 @@ module type S = sig
If a key occurs several times, all its bindings are combined using the
function [f], with [f key v1 v2] being called with [v1] occurring
later in the list than [v2].
@since NEXT_RELEASE *)
@since 3.3 *)

val add_list : 'a t -> (key * 'a) list -> 'a t
(** [add_list m l] adds the given list [l] of bindings to the map [m].
Expand All @@ -142,7 +142,7 @@ module type S = sig
val add_list_with : f:(key -> 'a -> 'a -> 'a) -> 'a t -> (key * 'a) list -> 'a t
(** [add_list ~f m l] adds the given list [l] of bindings to the map [m],
using [f] to combine values that have the same key.
@since NEXT_RELEASE *)
@since 3.3 *)

val keys : _ t -> key iter
(** [keys m] iterates on the keys of [m] only, creating an [iter] of keys.
Expand Down
Loading

0 comments on commit 739dd44

Please sign in to comment.