From 446ae9f26bab49091a0b44327c949cae3916e7f9 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sun, 21 Jan 2018 15:38:34 -0600 Subject: [PATCH] prepare for 2.0 --- CHANGELOG.adoc | 25 +++++++++++++++++++++++- HOWTO.adoc | 32 ------------------------------- Makefile | 6 ++---- README.adoc | 26 +++++++++++++++++++++++++ containers.opam | 4 ++-- src/core/CCEqual.mli | 2 +- src/core/CCHashtbl.ml | 2 +- src/core/CCHashtbl.mli | 4 ++-- src/core/CCList.mli | 10 +++++----- src/core/CCListLabels.mli | 10 +++++----- src/core/CCString.mli | 4 ++-- src/data/CCHashTrie.mli | 2 +- src/data/CCWBTree.mli | 2 +- src/monomorphic/CCMonomorphic.mli | 2 +- 14 files changed, 73 insertions(+), 58 deletions(-) delete mode 100644 HOWTO.adoc diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index f7f90225..aa9a6e2e 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -1,6 +1,29 @@ = Changelog -== 1.5.1 +== 2.0 + +=== breaking + +- move to jbuilder (closes #165), requiring at least OCaml 4.02 +- become defensive w.r.t polymorphic operators: + * Internally shadow polymorphic operators and functions from Pervasives + by `include CCMonomorphic` in `Containers` module + * Shadow the physical equality operator + * Shadow polymorphic functions in `CCList` +- rename `print` to `pp` for Format printers (closes #153) +- remove `CCFlatHashtbl` + +=== others + +- many typos and style fixes (from Fourchaux) +- Add `CCList.iteri2` and `CCList.foldi2` +- remove `PARAM.min_size` in `CCPool` +- Add `CCEqual.physical` +- Avoid uses of the polymorphic operators +- Add a `CCMonomorphic` module shipped into a `containers.monomorphic` library +- make complexity of `Array.lookup` explicit (closes #174) + +== 1.5.1, 1.5.2 - re-export `Format` types and functions in `CCFormat` diff --git a/HOWTO.adoc b/HOWTO.adoc deleted file mode 100644 index ea0f84d9..00000000 --- a/HOWTO.adoc +++ /dev/null @@ -1,32 +0,0 @@ -= HOWTO - -== Make a release - -Beforehand, check `grep deprecated -r src` to see whether some functions -can be removed. - -. `make test` -. update version in `_oasis` -. `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. -. update `CHANGELOG.adoc` (see its end to find the right git command) -. commit the changes -. `git checkout stable` -. `git merge master` -. `oasis setup; make test doc` -. update `opam` (the version field; remove `oasis` in deps) -. tag, and push both to github -. `opam pin add containers https://github.com/c-cube/ocaml-containers.git#` -. new opam package: `opam publish prepare; opam publish submit` -. re-generate doc: `make doc push_doc` - -== List Authors - - `git log --format='%aN' | sort -u` - -== Subtree - -If gen is https://github.com/c-cube/gen.git[this remote]: - - git subtree pull --prefix gen gen master --squash diff --git a/Makefile b/Makefile index dceec126..a8f4b12f 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ -# OASIS_START -# DO NOT EDIT (digest: 4c293511860bb966e727ba6f0ecc8197) all: build test @@ -27,8 +25,8 @@ VERSION=$(shell awk '/^version:/ {print $$2}' containers.opam) update_next_tag: @echo "update version to $(VERSION)..." - sed -i "s/NEXT_VERSION/$(VERSION)/g" src/*.ml src/*.mli - sed -i "s/NEXT_RELEASE/$(VERSION)/g" src/*.ml src/*.mli + sed -i "s/NEXT_VERSION/$(VERSION)/g" $(wildcard src/**/*.ml) $(wildcard src/**/*.mli) + sed -i "s/NEXT_RELEASE/$(VERSION)/g" $(wildcard src/**/*.ml) $(wildcard src/**/*.mli) watch: while find src/ benchs/ -print0 | xargs -0 inotifywait -e delete_self -e modify ; do \ diff --git a/README.adoc b/README.adoc index 8bddf08e..a1468a93 100644 --- a/README.adoc +++ b/README.adoc @@ -476,3 +476,29 @@ See link:doc/containers.adoc[the extended documentation] for more examples. Powered by image:http://oasis.forge.ocamlcore.org/oasis-badge.png[alt="OASIS", style="border: none;", link="http://oasis.forge.ocamlcore.org/"] +== HOWTO (for contributors) + +=== Make a release + +Beforehand, check `grep deprecated -r src` to see whether some functions +can be removed. + +. `make test` +. update version in `_oasis` +. `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. +. update `CHANGELOG.adoc` (see its end to find the right git command) +. commit the changes +. `git checkout stable` +. `git merge master` +. `oasis setup; make test doc` +. update `opam` (the version field; remove `oasis` in deps) +. tag, and push both to github +. `opam pin add containers https://github.com/c-cube/ocaml-containers.git#` +. new opam package: `opam publish prepare; opam publish submit` +. re-generate doc: `make doc push_doc` + +=== List Authors + + `git log --format='%aN' | sort -u` diff --git a/containers.opam b/containers.opam index 982e7fb2..60f4c92f 100644 --- a/containers.opam +++ b/containers.opam @@ -1,8 +1,8 @@ opam-version: "1.2" name: "containers" -version: "dev" +version: "2.0" author: "Simon Cruanes" -maintainer: "simon.cruanes@inria.fr" +maintainer: "simon.cruanes.2007@m4x.org" build: [ ["jbuilder" "build" "-p" name "-j" jobs] ] diff --git a/src/core/CCEqual.mli b/src/core/CCEqual.mli index efcbc3ea..76a60bef 100644 --- a/src/core/CCEqual.mli +++ b/src/core/CCEqual.mli @@ -13,7 +13,7 @@ val poly : 'a t val physical : 'a t (** Standard physical equality - @since NEXT_RELEASE *) + @since 2.0 *) val int : int t val string : string t diff --git a/src/core/CCHashtbl.ml b/src/core/CCHashtbl.ml index 00750e7b..d944919c 100644 --- a/src/core/CCHashtbl.ml +++ b/src/core/CCHashtbl.ml @@ -235,7 +235,7 @@ module type S = sig val pp : key printer -> 'a printer -> 'a t printer (** Printer for table @since 0.13 - Renamed from [print] @since NEXT_RELEASE *) + Renamed from [print] @since 2.0 *) end (*$inject diff --git a/src/core/CCHashtbl.mli b/src/core/CCHashtbl.mli index 223f8e28..27202e2f 100644 --- a/src/core/CCHashtbl.mli +++ b/src/core/CCHashtbl.mli @@ -105,7 +105,7 @@ module Poly : sig val pp : 'a printer -> 'b printer -> ('a, 'b) Hashtbl.t printer (** Printer for table @since 0.13 - Renamed from [print] @since NEXT_RELEASE *) + Renamed from [print] @since 2.0 *) end include module type of Poly @@ -205,7 +205,7 @@ module type S = sig val pp : key printer -> 'a printer -> 'a t printer (** Printer for tables @since 0.13 - Renamed from {!print} @since NEXT_RELEASE *) + Renamed from {!print} @since 2.0 *) end module Make(X : Hashtbl.HashedType) : diff --git a/src/core/CCList.mli b/src/core/CCList.mli index d0a85896..8dba2044 100644 --- a/src/core/CCList.mli +++ b/src/core/CCList.mli @@ -363,7 +363,7 @@ val iteri : (int -> 'a -> unit) -> 'a t -> unit val iteri2 : (int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit (** @raise Invalid_argument when lists do not have the same length. - @since NEXT_RELEASE *) + @since 2.0 *) val foldi : ('b -> int -> 'a -> 'b) -> 'b -> 'a t -> 'b (** Fold on list, with index. *) @@ -371,7 +371,7 @@ val foldi : ('b -> int -> 'a -> 'b) -> 'b -> 'a t -> 'b val foldi2 : ('c -> int -> 'a -> 'b -> 'c) -> 'c -> 'a t -> 'b t -> 'c (** Fold on two lists, with index. @raise Invalid_argument when lists do not have the same length. - @since NEXT_RELEASE *) + @since 2.0 *) val get_at_idx : int -> 'a t -> 'a option (** Get by index in the list. @@ -501,7 +501,7 @@ end val assoc : eq:('a -> 'a -> bool) -> 'a -> ('a * 'b) t -> 'b (** Same as [Assoc.get_exn]. - @since NEXT_RELEASE *) + @since 2.0 *) val assoc_opt : eq:('a -> 'a -> bool) -> 'a -> ('a * 'b) t -> 'b option (** Same as [Assoc.get]. @@ -513,11 +513,11 @@ val assq_opt : 'a -> ('a * 'b) t -> 'b option val mem_assoc : eq:('a -> 'a -> bool) -> 'a -> ('a * _) t -> bool (** Same as [Assoc.mem]. - @since NEXT_RELEASE *) + @since 2.0 *) val remove_assoc : eq:('a -> 'a -> bool) -> 'a -> ('a * 'b) t -> ('a * 'b) t (** Same as [Assoc.remove]. - @since NEXT_RELEASE *) + @since 2.0 *) (** {2 References on Lists} @since 0.3.3 *) diff --git a/src/core/CCListLabels.mli b/src/core/CCListLabels.mli index 60435e1c..66f477c0 100644 --- a/src/core/CCListLabels.mli +++ b/src/core/CCListLabels.mli @@ -374,23 +374,23 @@ end val assoc : eq:('a -> 'a -> bool) -> 'a -> ('a * 'b) t -> 'b (** Same as [Assoc.get_exn]. - @since NEXT_RELEASE *) + @since 2.0 *) val assoc_opt : eq:('a -> 'a -> bool) -> 'a -> ('a * 'b) t -> 'b option (** Same as [Assoc.get]. - @since NEXT_RELEASE *) + @since 2.0 *) val assq_opt : 'a -> ('a * 'b) t -> 'b option (** Safe version of {!assq}. - @since NEXT_RELEASE *) + @since 2.0 *) val mem_assoc : eq:('a -> 'a -> bool) -> 'a -> ('a * _) t -> bool (** Same as [Assoc.mem]. - @since NEXT_RELEASE *) + @since 2.0 *) val remove_assoc : eq:('a -> 'a -> bool) -> 'a -> ('a * 'b) t -> ('a * 'b) t (** Same as [Assoc.remove]. - @since NEXT_RELEASE *) + @since 2.0 *) (** {2 References on Lists} @since 0.3.3 *) diff --git a/src/core/CCString.mli b/src/core/CCString.mli index d52b030a..15eeaa84 100644 --- a/src/core/CCString.mli +++ b/src/core/CCString.mli @@ -43,12 +43,12 @@ module type S = sig val pp_buf : Buffer.t -> t -> unit (** Renamed from [pp]. - @since NEXT_RELEASE *) + @since 2.0 *) val pp : Format.formatter -> t -> unit (** Print the string within quotes. Renamed from [print]. - @since NEXT_RELEASE *) + @since 2.0 *) end (** {2 Strings} *) diff --git a/src/data/CCHashTrie.mli b/src/data/CCHashTrie.mli index 662af8ec..36c51945 100644 --- a/src/data/CCHashTrie.mli +++ b/src/data/CCHashTrie.mli @@ -140,7 +140,7 @@ module type S = sig val pp : key printer -> 'a printer -> 'a t printer (** Renamed from [val print]. - @since NEXT_RELEASE *) + @since 2.0 *) val as_tree : 'a t -> [`L of int * (key * 'a) list | `N ] ktree (** For debugging purpose: explore the structure of the tree, diff --git a/src/data/CCWBTree.mli b/src/data/CCWBTree.mli index c6f13f98..58e6b188 100644 --- a/src/data/CCWBTree.mli +++ b/src/data/CCWBTree.mli @@ -128,7 +128,7 @@ module type S = sig val pp : key printer -> 'a printer -> 'a t printer (** Renamed from [val print]. - @since NEXT_RELEASE *) + @since 2.0 *) (**/**) val node_ : key -> 'a -> 'a t -> 'a t -> 'a t diff --git a/src/monomorphic/CCMonomorphic.mli b/src/monomorphic/CCMonomorphic.mli index d11e1514..382fd003 100644 --- a/src/monomorphic/CCMonomorphic.mli +++ b/src/monomorphic/CCMonomorphic.mli @@ -2,7 +2,7 @@ (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Shadow unsafe functions and operators from Pervasives} *) -(** @since NEXT_RELEASE *) +(** @since 2.0 *) val (=) : int -> int -> bool val (<>) : int -> int -> bool