mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
prepare for 3.13
This commit is contained in:
parent
f68d187142
commit
7c1ca1d82f
13 changed files with 133 additions and 58 deletions
27
CHANGELOG.md
27
CHANGELOG.md
|
|
@ -1,5 +1,32 @@
|
||||||
# Changelog
|
# 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
|
## 3.12
|
||||||
|
|
||||||
- add `containers.pp` sublibrary, with Wadler-style pretty printing combinators
|
- add `containers.pp` sublibrary, with Wadler-style pretty printing combinators
|
||||||
|
|
|
||||||
|
|
@ -1,26 +1,26 @@
|
||||||
|
# This file is generated by dune, edit dune-project instead
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
version: "3.12"
|
version: "3.13"
|
||||||
author: "Simon Cruanes"
|
|
||||||
maintainer: "simon.cruanes.2007@m4x.org"
|
|
||||||
synopsis: "A set of advanced datatypes for containers"
|
synopsis: "A set of advanced datatypes for containers"
|
||||||
|
maintainer: ["c-cube"]
|
||||||
|
authors: ["c-cube"]
|
||||||
license: "BSD-2-Clause"
|
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: [
|
build: [
|
||||||
["dune" "build" "-p" name "-j" jobs]
|
["dune" "build" "-p" name "-j" jobs]
|
||||||
["dune" "build" "@doc" "-p" name ] {with-doc}
|
["dune" "build" "@doc" "-p" name ] {with-doc}
|
||||||
["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "x86_32" & arch != "arm32"}
|
["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
containers-data.opam.template
Normal file
5
containers-data.opam.template
Normal file
|
|
@ -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"}
|
||||||
|
]
|
||||||
|
|
@ -1,34 +1,31 @@
|
||||||
|
# This file is generated by dune, edit dune-project instead
|
||||||
opam-version: "2.0"
|
opam-version: "2.0"
|
||||||
name: "containers"
|
version: "3.13"
|
||||||
version: "3.12"
|
synopsis:
|
||||||
author: "Simon Cruanes"
|
"A modular, clean and powerful extension of the OCaml standard library"
|
||||||
maintainer: "simon.cruanes.2007@m4x.org"
|
maintainer: ["c-cube"]
|
||||||
|
authors: ["c-cube"]
|
||||||
license: "BSD-2-Clause"
|
license: "BSD-2-Clause"
|
||||||
synopsis: "A modular, clean and powerful extension of the OCaml standard library"
|
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: [
|
||||||
|
"dune" {>= "2.9"}
|
||||||
|
"ocaml" {>= "4.08"}
|
||||||
|
"either"
|
||||||
|
"dune-configurator"
|
||||||
|
"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"]
|
||||||
|
dev-repo: "git+https://github.com/c-cube/ocaml-containers.git"
|
||||||
build: [
|
build: [
|
||||||
["dune" "build" "-p" name "-j" jobs]
|
["dune" "build" "-p" name "-j" jobs]
|
||||||
["dune" "build" "@doc" "-p" name ] {with-doc}
|
["dune" "build" "@doc" "-p" name ] {with-doc}
|
||||||
["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "x86_32" & arch != "arm32"}
|
["dune" "runtest" "-p" name "-j" jobs] {with-test & arch != "x86_32" & arch != "arm32"}
|
||||||
]
|
]
|
||||||
depends: [
|
|
||||||
"ocaml" { >= "4.08.0" }
|
|
||||||
"dune" { >= "2.0" }
|
|
||||||
"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"
|
|
||||||
]
|
|
||||||
tags: [ "stdlib" "containers" "iterators" "list" "heap" "queue" ]
|
|
||||||
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
containers.opam.template
Normal file
5
containers.opam.template
Normal file
|
|
@ -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
dune-project
43
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)))
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,11 @@ val equal : t -> t -> bool
|
||||||
|
|
||||||
val if_then : (unit -> 'a) -> t -> 'a option
|
val if_then : (unit -> 'a) -> t -> 'a option
|
||||||
(** [if_then f x] is [Some (f ())] if [x] is true and None otherwise.
|
(** [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
|
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.
|
(** [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
|
val to_int : t -> int
|
||||||
(** [to_int true = 1], [to_int false = 0].
|
(** [to_int true = 1], [to_int false = 0].
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ val unfold : ('seed -> ('b * 'seed) option) -> 'seed -> 'b list
|
||||||
when [f] produces [None], list production ends.
|
when [f] produces [None], list production ends.
|
||||||
{b NOTE} if [f] never produces [None], then a {b stack overflow will occur}. Therefore,
|
{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].
|
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
|
val count : ('a -> bool) -> 'a list -> int
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
(action
|
(action
|
||||||
(run %{project_root}/src/core/cpp/cpp.exe %{input-file})))
|
(run %{project_root}/src/core/cpp/cpp.exe %{input-file})))
|
||||||
(flags :standard -nolabels -open CCMonomorphic)
|
(flags :standard -nolabels -open CCMonomorphic)
|
||||||
(libraries seq either containers.monomorphic))
|
(libraries either containers.monomorphic))
|
||||||
|
|
||||||
(ocamllex
|
(ocamllex
|
||||||
(modules CCSexp_lex))
|
(modules CCSexp_lex))
|
||||||
|
|
|
||||||
|
|
@ -226,19 +226,19 @@ module type BIDIR = sig
|
||||||
|
|
||||||
val find_left : t -> left -> right list
|
val find_left : t -> left -> right list
|
||||||
(** List of values for this given left-key.
|
(** 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
|
val find_left_iter : t -> left -> right iter
|
||||||
(** Iterate on bindings for this given left-key
|
(** Iterate on bindings for this given left-key
|
||||||
@since NEXT_RELEASE *)
|
@since 3.13 *)
|
||||||
|
|
||||||
val find_right : t -> right -> left list
|
val find_right : t -> right -> left list
|
||||||
(** List of values for this given right-key.
|
(** 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
|
val find_right_iter : t -> right -> left iter
|
||||||
(** Iterate on bindings for this given left-key
|
(** Iterate on bindings for this given left-key
|
||||||
@since NEXT_RELEASE *)
|
@since 3.13 *)
|
||||||
|
|
||||||
val find1_left : t -> left -> right option
|
val find1_left : t -> left -> right option
|
||||||
(** like {!find_left} but returns at most one value *)
|
(** like {!find_left} but returns at most one value *)
|
||||||
|
|
|
||||||
|
|
@ -124,14 +124,14 @@ module type BIDIR = sig
|
||||||
|
|
||||||
val find_left_iter : t -> left -> right iter
|
val find_left_iter : t -> left -> right iter
|
||||||
(** Iterate on bindings for this given left-key.
|
(** Iterate on bindings for this given left-key.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.13 *)
|
||||||
|
|
||||||
val find_right : t -> right -> left list
|
val find_right : t -> right -> left list
|
||||||
(** List of values for this given right-key. *)
|
(** List of values for this given right-key. *)
|
||||||
|
|
||||||
val find_right_iter : t -> right -> left iter
|
val find_right_iter : t -> right -> left iter
|
||||||
(** Iterate on bindings for this given left-key.
|
(** Iterate on bindings for this given left-key.
|
||||||
@since NEXT_RELEASE *)
|
@since 3.13 *)
|
||||||
|
|
||||||
val find1_left : t -> left -> right option
|
val find1_left : t -> left -> right option
|
||||||
(** Like {!find_left} but returns at most one value. *)
|
(** Like {!find_left} but returns at most one value. *)
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ val newline_or_spaces : int -> t
|
||||||
(** [newline_or_spaces n] either prints a newline (respecting indentation),
|
(** [newline_or_spaces n] either prints a newline (respecting indentation),
|
||||||
or prints [n] spaces. {!newline} is basically [newline_or_spaces 1].
|
or prints [n] spaces. {!newline} is basically [newline_or_spaces 1].
|
||||||
@raise Invalid_argument if [n < 0].
|
@raise Invalid_argument if [n < 0].
|
||||||
@since NEXT_RELEASE *)
|
@since 3.13 *)
|
||||||
|
|
||||||
val nl : t
|
val nl : t
|
||||||
(** Alias for {!newline} *)
|
(** Alias for {!newline} *)
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,4 @@
|
||||||
(public_name containers.pp)
|
(public_name containers.pp)
|
||||||
(synopsis "Pretty printer for Containers")
|
(synopsis "Pretty printer for Containers")
|
||||||
(flags :standard)
|
(flags :standard)
|
||||||
(libraries containers seq))
|
(libraries containers))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue