Skip to content

Commit

Permalink
prepare for 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Dec 5, 2023
1 parent f68d187 commit 7c1ca1d
Show file tree
Hide file tree
Showing 13 changed files with 133 additions and 58 deletions.
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
36 changes: 18 additions & 18 deletions containers-data.opam
Original file line number Diff line number Diff line change
@@ -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/"
5 changes: 5 additions & 0 deletions containers-data.opam.template
Original file line number Diff line number Diff line change
@@ -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"}
]
51 changes: 24 additions & 27 deletions containers.opam
Original file line number Diff line number Diff line change
@@ -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"}
]
5 changes: 5 additions & 0 deletions containers.opam.template
Original file line number Diff line number Diff line change
@@ -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"}
]
43 changes: 42 additions & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -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)))
4 changes: 2 additions & 2 deletions src/core/CCBool.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCList.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/dune
Original file line number Diff line number Diff line change
Expand Up @@ -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))
8 changes: 4 additions & 4 deletions src/data/CCMultiMap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 *)
Expand Down
4 changes: 2 additions & 2 deletions src/data/CCMultiMap.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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. *)
Expand Down
2 changes: 1 addition & 1 deletion src/pp/containers_pp.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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} *)
Expand Down
2 changes: 1 addition & 1 deletion src/pp/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
(public_name containers.pp)
(synopsis "Pretty printer for Containers")
(flags :standard)
(libraries containers seq))
(libraries containers))

0 comments on commit 7c1ca1d

Please sign in to comment.