diff --git a/CHANGELOG.md b/CHANGELOG.md index 8302baef9..337439fd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,32 @@ # Changelog +## 3.13 + +- breaking: delete containers-thread (which was deprecated) +- breaking: pp: modify `Ext.t` so it takes surrounding value +- CCMultiMap: Rename functions find_left and find_right in the bidirectional multimap + to find_left_iter and find_right_iter respectively to reflect their usage, + and add new functions to replace the old find_left and find_right + that return a list of values rather than an iterator, + to make the signatures of CCMultiMap.S and CCMultiMap.BIDIR cohere. + Additionally, change the return type of + `S.find_iter` from `t -> key -> (value -> unit) -> unit` to `t -> key -> value iter`. + +- CCList: add `unfold` +- CCBool: Add functions if_then and if_then_else +- CCList: remove some functions that are subsumed by the stdlib +- CCList: use TRMC for many functions on 5.1 +- feat CCFunvec: add `fold_rev` +- add `Containers_pp.newline_or_spaces` +- cleanup: remove stubs for code always present on 4.08, rely on + newer functions in 5.1 +- remove last refs to `CCShims` + +- perf: accelerate `List.append` and `List.flat_map` on 5.1 + +- more warnings, more tests, cleanup dead code +- change COC to ocaml-coc + ## 3.12 - add `containers.pp` sublibrary, with Wadler-style pretty printing combinators diff --git a/containers-data.opam b/containers-data.opam index 1861d2223..57845e979 100644 --- a/containers-data.opam +++ b/containers-data.opam @@ -1,26 +1,26 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -version: "3.12" -author: "Simon Cruanes" -maintainer: "simon.cruanes.2007@m4x.org" +version: "3.13" synopsis: "A set of advanced datatypes for containers" +maintainer: ["c-cube"] +authors: ["c-cube"] license: "BSD-2-Clause" +tags: ["containers" "RAL" "function" "vector" "okasaki"] +homepage: "https://github.com/c-cube/ocaml-containers/" +bug-reports: "https://github.com/c-cube/ocaml-containers/issues" +depends: [ + "dune" {>= "2.9"} + "ocaml" {>= "4.08"} + "containers" {= version} + "qcheck-core" {>= "0.18" & with-test} + "iter" {with-test} + "gen" {with-test} + "mdx" {with-test} + "odoc" {with-doc} +] +dev-repo: "git+https://github.com/c-cube/ocaml-containers.git" build: [ ["dune" "build" "-p" name "-j" jobs] ["dune" "build" "@doc" "-p" name ] {with-doc} ["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "x86_32" & arch != "arm32"} ] -depends: [ - "ocaml" { >= "4.08.0" } - "dune" { >= "2.0" } - "containers" { = version } -| "qcheck-core" {>= "0.20" & with-test} - "iter" { with-test } - "gen" { with-test } - "mdx" { with-test } - "odoc" { with-doc } -] -tags: [ "containers" "RAL" "functional" "vector" "okasaki" ] -homepage: "https://github.com/c-cube/ocaml-containers/" -doc: "https://c-cube.github.io/ocaml-containers" -dev-repo: "git+https://github.com/c-cube/ocaml-containers.git" -bug-reports: "https://github.com/c-cube/ocaml-containers/issues/" diff --git a/containers-data.opam.template b/containers-data.opam.template new file mode 100644 index 000000000..fc3b4beac --- /dev/null +++ b/containers-data.opam.template @@ -0,0 +1,5 @@ +build: [ + ["dune" "build" "-p" name "-j" jobs] + ["dune" "build" "@doc" "-p" name ] {with-doc} + ["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "x86_32" & arch != "arm32"} +] diff --git a/containers.opam b/containers.opam index bc23aeda2..e0e46c440 100644 --- a/containers.opam +++ b/containers.opam @@ -1,34 +1,31 @@ +# This file is generated by dune, edit dune-project instead opam-version: "2.0" -name: "containers" -version: "3.12" -author: "Simon Cruanes" -maintainer: "simon.cruanes.2007@m4x.org" +version: "3.13" +synopsis: + "A modular, clean and powerful extension of the OCaml standard library" +maintainer: ["c-cube"] +authors: ["c-cube"] license: "BSD-2-Clause" -synopsis: "A modular, clean and powerful extension of the OCaml standard library" -build: [ - ["dune" "build" "-p" name "-j" jobs] - ["dune" "build" "@doc" "-p" name ] {with-doc} - ["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "x86_32" & arch != "arm32"} -] +tags: ["stdlib" "containers" "iterators" "list" "heap" "queue"] +homepage: "https://github.com/c-cube/ocaml-containers/" +bug-reports: "https://github.com/c-cube/ocaml-containers/issues" depends: [ - "ocaml" { >= "4.08.0" } - "dune" { >= "2.0" } + "dune" {>= "2.9"} + "ocaml" {>= "4.08"} + "either" "dune-configurator" - "either" # compat "qcheck-core" {>= "0.18" & with-test} - "yojson" { with-test } - "iter" { with-test } - "gen" { with-test } - "csexp" { with-test } - "uutf" { with-test } - "odoc" { with-doc } -] -depopts: [ - "base-unix" - "base-threads" + "yojson" {with-test} + "iter" {with-test} + "gen" {with-test} + "csexp" {with-test} + "uutf" {with-test} + "odoc" {with-doc} ] -tags: [ "stdlib" "containers" "iterators" "list" "heap" "queue" ] -homepage: "https://github.com/c-cube/ocaml-containers/" -doc: "https://c-cube.github.io/ocaml-containers" +depopts: ["base-unix" "base-threads"] dev-repo: "git+https://github.com/c-cube/ocaml-containers.git" -bug-reports: "https://github.com/c-cube/ocaml-containers/issues/" +build: [ + ["dune" "build" "-p" name "-j" jobs] + ["dune" "build" "@doc" "-p" name ] {with-doc} + ["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "x86_32" & arch != "arm32"} +] diff --git a/containers.opam.template b/containers.opam.template new file mode 100644 index 000000000..fc3b4beac --- /dev/null +++ b/containers.opam.template @@ -0,0 +1,5 @@ +build: [ + ["dune" "build" "-p" name "-j" jobs] + ["dune" "build" "@doc" "-p" name ] {with-doc} + ["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "x86_32" & arch != "arm32"} +] diff --git a/dune-project b/dune-project index 929c696e5..392ee7558 100644 --- a/dune-project +++ b/dune-project @@ -1 +1,42 @@ -(lang dune 2.0) +(lang dune 2.9) +(name containers) +(generate_opam_files true) + +(version 3.13) +(authors c-cube) +(maintainers c-cube) +(license BSD-2-Clause) +(homepage "https://github.com/c-cube/ocaml-containers/") +(source (github c-cube/ocaml-containers)) + +(package + (name containers) + (synopsis "A modular, clean and powerful extension of the OCaml standard library") + (tags (stdlib containers iterators list heap queue)) + (depends + (ocaml (>= 4.08)) + either + dune-configurator + (qcheck-core (and (>= 0.18) :with-test)) + (yojson :with-test) + (iter :with-test) + (gen :with-test) + (csexp :with-test) + (uutf :with-test) + (odoc :with-doc)) + (depopts + base-unix + base-threads)) + +(package + (name containers-data) + (synopsis "A set of advanced datatypes for containers") + (tags (containers RAL function vector okasaki)) + (depends + (ocaml (>= 4.08)) + (containers (= :version)) + (qcheck-core (and (>= 0.18) :with-test)) + (iter :with-test) + (gen :with-test) + (mdx :with-test) + (odoc :with-doc))) diff --git a/src/core/CCBool.mli b/src/core/CCBool.mli index d179f95d8..0ac4c40c0 100644 --- a/src/core/CCBool.mli +++ b/src/core/CCBool.mli @@ -12,11 +12,11 @@ val equal : t -> t -> bool val if_then : (unit -> 'a) -> t -> 'a option (** [if_then f x] is [Some (f ())] if [x] is true and None otherwise. - @since NEXT_RELEASE *) + @since 3.13 *) val if_then_else : (unit -> 'a) -> (unit -> 'a) -> t -> 'a (** [if_then_else f g x] is [f ()] if [x] is true and [g ()] otherwise. - @since NEXT_RELEASE *) + @since 3.13 *) val to_int : t -> int (** [to_int true = 1], [to_int false = 0]. diff --git a/src/core/CCList.mli b/src/core/CCList.mli index 670be9042..865dca796 100644 --- a/src/core/CCList.mli +++ b/src/core/CCList.mli @@ -109,7 +109,7 @@ val unfold : ('seed -> ('b * 'seed) option) -> 'seed -> 'b list when [f] produces [None], list production ends. {b NOTE} if [f] never produces [None], then a {b stack overflow will occur}. Therefore, great care must be taken to ensure that [f] will produce [None]. - @since NEXT_RELEASE + @since 3.13 *) val count : ('a -> bool) -> 'a list -> int diff --git a/src/core/dune b/src/core/dune index 3d2c5c2ad..cc17ce834 100644 --- a/src/core/dune +++ b/src/core/dune @@ -6,7 +6,7 @@ (action (run %{project_root}/src/core/cpp/cpp.exe %{input-file}))) (flags :standard -nolabels -open CCMonomorphic) - (libraries seq either containers.monomorphic)) + (libraries either containers.monomorphic)) (ocamllex (modules CCSexp_lex)) diff --git a/src/data/CCMultiMap.ml b/src/data/CCMultiMap.ml index 7a8407b11..9129b51ca 100644 --- a/src/data/CCMultiMap.ml +++ b/src/data/CCMultiMap.ml @@ -226,19 +226,19 @@ module type BIDIR = sig val find_left : t -> left -> right list (** List of values for this given left-key. - This used to return an iter, but returns a list since NEXT_RELEASE. *) + This used to return an iter, but returns a list since 3.13. *) val find_left_iter : t -> left -> right iter (** Iterate on bindings for this given left-key - @since NEXT_RELEASE *) + @since 3.13 *) val find_right : t -> right -> left list (** List of values for this given right-key. - This used to return an iter, but returns a list since NEXT_RELEASE. *) + This used to return an iter, but returns a list since 3.13. *) val find_right_iter : t -> right -> left iter (** Iterate on bindings for this given left-key - @since NEXT_RELEASE *) + @since 3.13 *) val find1_left : t -> left -> right option (** like {!find_left} but returns at most one value *) diff --git a/src/data/CCMultiMap.mli b/src/data/CCMultiMap.mli index 9f5365f14..7b5840e9f 100644 --- a/src/data/CCMultiMap.mli +++ b/src/data/CCMultiMap.mli @@ -124,14 +124,14 @@ module type BIDIR = sig val find_left_iter : t -> left -> right iter (** Iterate on bindings for this given left-key. - @since NEXT_RELEASE *) + @since 3.13 *) val find_right : t -> right -> left list (** List of values for this given right-key. *) val find_right_iter : t -> right -> left iter (** Iterate on bindings for this given left-key. - @since NEXT_RELEASE *) + @since 3.13 *) val find1_left : t -> left -> right option (** Like {!find_left} but returns at most one value. *) diff --git a/src/pp/containers_pp.mli b/src/pp/containers_pp.mli index 80cce5aec..f5ff88d45 100644 --- a/src/pp/containers_pp.mli +++ b/src/pp/containers_pp.mli @@ -78,7 +78,7 @@ val newline_or_spaces : int -> t (** [newline_or_spaces n] either prints a newline (respecting indentation), or prints [n] spaces. {!newline} is basically [newline_or_spaces 1]. @raise Invalid_argument if [n < 0]. - @since NEXT_RELEASE *) + @since 3.13 *) val nl : t (** Alias for {!newline} *) diff --git a/src/pp/dune b/src/pp/dune index fbf9d1fbe..2220457cb 100644 --- a/src/pp/dune +++ b/src/pp/dune @@ -4,4 +4,4 @@ (public_name containers.pp) (synopsis "Pretty printer for Containers") (flags :standard) - (libraries containers seq)) + (libraries containers))