From 6e50ff41c693bd7908024da9129a1cfda9567d39 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 28 Mar 2018 20:26:17 -0500 Subject: [PATCH] prepare for 2.1 --- CHANGELOG.adoc | 28 ++++++++++++++++++++++++++++ containers.opam | 2 +- src/core/CCArrayLabels.mli | 12 ++++++------ src/core/CCFloat.mli | 10 +++++----- src/core/CCFormat.mli | 2 +- src/core/CCFun.mli | 2 +- src/core/CCHash.mli | 4 ++-- src/core/CCInt.mli | 26 +++++++++++++------------- src/core/CCInt32.mli | 2 +- src/core/CCInt64.mli | 12 ++++++------ src/core/CCList.mli | 4 ++-- src/core/CCNativeint.mli | 2 +- src/core/CCUtf8_string.mli | 2 +- src/data/CCBijection.mli | 2 +- src/data/CCFun_vec.mli | 2 +- src/iter/CCLazy_list.mli | 4 ++-- src/monomorphic/CCMonomorphic.mli | 14 +++++++------- 17 files changed, 79 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 7e766c84..243ca122 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -1,5 +1,33 @@ = Changelog +== 2.1 + +- make `CCInt64` compatible with `Int64` (breaking!) (closes #192) + +- Add `CCBijection` in containers.data +- feat(mono): add dotted comparison operators for floats +- add `?margin` parameter to `CCFormat.ksprintf` +- add `CCUtf8_string` with basic encoding and decoding functionalities +- Add `CCLazy_list.<|>` +- Adding `CCNativeint` +- enrich `CCInt.Infix` to get a uniform interface with `CCInt{32,64}` +- add `CCInt{32,64}.Infix` +- Adding CCInt32 module +- add `CCHash.combine{5,6}` +- Add infix operators to CCFloat +- feat(list): add `{interleave,intersperse}` (closes #191) +- add missing signatures of `CCArrayLabels` (closes #193) +- Add CCFun.iterate +- add experimental `CCFun_vec` data structure for fast functional vectors + +- fix: strong type aliases in Random (closes #210) +- use standard `List.sort_uniq` +- remove explicit dep on `bytes` in jbuild files +- update printers names in containers.top (closes #201) +- Enable support for Travis CI and Appveyor +- test deps are required when we run tests +- point to JST's blog post on poly compare + == 2.0 === breaking diff --git a/containers.opam b/containers.opam index 612c6187..ded5b0ed 100644 --- a/containers.opam +++ b/containers.opam @@ -1,6 +1,6 @@ opam-version: "1.2" name: "containers" -version: "2.0" +version: "2.1" author: "Simon Cruanes" maintainer: "simon.cruanes.2007@m4x.org" build: [ diff --git a/src/core/CCArrayLabels.mli b/src/core/CCArrayLabels.mli index 4e7bc98e..51cfac5f 100644 --- a/src/core/CCArrayLabels.mli +++ b/src/core/CCArrayLabels.mli @@ -70,13 +70,13 @@ val fold_while : f:('a -> 'b -> 'a * [`Stop | `Continue]) -> init:'a -> 'b t -> val fold_map : f:('acc -> 'a -> 'acc * 'b) -> init:'acc -> 'a t -> 'acc * 'b t (** [fold_map f acc a] is a [fold_left]-like function, but it also maps the array to another array. - @since NEXT_RELEASE *) + @since 2.1 *) val scan_left : f:('acc -> 'a -> 'acc) -> init:'acc -> 'a t -> 'acc t (** [scan_left f acc a] returns the array [ [|acc; f acc x0; f (f acc a.(0)) a.(1); …|] ]. - @since NEXT_RELEASE *) + @since 2.1 *) val iter : f:('a -> unit) -> 'a t -> unit @@ -130,21 +130,21 @@ val sort_ranking : f:('a -> 'a -> int) -> 'a t -> int array val find_map : f:('a -> 'b option) -> 'a t -> 'b option (** [find_map f a] returns [Some y] if there is an element [x] such that [f x = Some y], else it returns [None]. - @since NEXT_RELEASE *) + @since 2.1 *) val find : f:('a -> 'b option) -> 'a t -> 'b option (** [find f a] returns [Some y] if there is an element [x] such that [f x = Some y], else it returns [None]. - @deprecated since NEXT_RELEASE *) + @deprecated since 2.1 *) val find_map_i : f:(int -> 'a -> 'b option) -> 'a t -> 'b option (** Like {!find_map}, but also pass the index to the predicate function. - @since NEXT_RELEASE *) + @since 2.1 *) val findi : f:(int -> 'a -> 'b option) -> 'a t -> 'b option (** Like {!find}, but also pass the index to the predicate function. @since 0.3.4 - @deprecated since NEXT_RELEASE *) + @deprecated since 2.1 *) val find_idx : f:('a -> bool) -> 'a t -> (int * 'a) option (** [find_idx p x] returns [Some (i,x)] where [x] is the [i]-th element of [l], diff --git a/src/core/CCFloat.mli b/src/core/CCFloat.mli index 77b3c46a..21ef0588 100644 --- a/src/core/CCFloat.mli +++ b/src/core/CCFloat.mli @@ -132,19 +132,19 @@ module Infix : sig (** @since 0.17 *) val (+) : t -> t -> t - (** Addition. @since NEXT_RELEASE *) + (** Addition. @since 2.1 *) val (-) : t -> t -> t - (** Subtraction. @since NEXT_RELEASE *) + (** Subtraction. @since 2.1 *) val (~-) : t -> t - (** Unary negation. @since NEXT_RELEASE *) + (** Unary negation. @since 2.1 *) val ( * ) : t -> t -> t - (** Multiplication. @since NEXT_RELEASE *) + (** Multiplication. @since 2.1 *) val (/) : t -> t -> t - (** Division. @since NEXT_RELEASE *) + (** Division. @since 2.1 *) end include module type of Infix diff --git a/src/core/CCFormat.mli b/src/core/CCFormat.mli index f7650483..9baaff0b 100644 --- a/src/core/CCFormat.mli +++ b/src/core/CCFormat.mli @@ -286,7 +286,7 @@ val ksprintf : 'a (** [ksprintf fmt ~f] formats using [fmt], in a way similar to {!sprintf}, and then calls [f] on the resulting string. - @param margin set margin (since NEXT_RELEASE) + @param margin set margin (since 2.1) @since 0.14 *) val to_file : string -> ('a, t, unit, unit) format4 -> 'a diff --git a/src/core/CCFun.mli b/src/core/CCFun.mli index 55d82c1e..2bdc77ef 100644 --- a/src/core/CCFun.mli +++ b/src/core/CCFun.mli @@ -79,7 +79,7 @@ val opaque_identity : 'a -> 'a val iterate : int -> ('a -> 'a) -> 'a -> 'a (** [iterate n f] is [f] iterated [n] times. That is to say, [iterate 0 f x] is [x], [iterate 1 f x] is [f x], [iterate 2 f x] is [f (f x)], etc. - @since NEXT_RELEASE *) + @since 2.1 *) (** {2 Monad} diff --git a/src/core/CCHash.mli b/src/core/CCHash.mli index fe86eac8..e17743a4 100644 --- a/src/core/CCHash.mli +++ b/src/core/CCHash.mli @@ -65,10 +65,10 @@ val combine3 : hash -> hash -> hash -> hash val combine4 : hash -> hash -> hash -> hash -> hash val combine5 : hash -> hash -> hash -> hash -> hash -> hash -(** @since NEXT_RELEASE *) +(** @since 2.1 *) val combine6 : hash -> hash -> hash -> hash -> hash -> hash -> hash -(** @since NEXT_RELEASE *) +(** @since 2.1 *) (** {2 Iterators} *) diff --git a/src/core/CCInt.mli b/src/core/CCInt.mli index 2d0389ac..de926e90 100644 --- a/src/core/CCInt.mli +++ b/src/core/CCInt.mli @@ -116,19 +116,19 @@ module Infix : sig (** Alias to {!range'}. @since 1.2 *) - val (+) : t -> t -> t (** @since NEXT_RELEASE *) - val (-) : t -> t -> t (** @since NEXT_RELEASE *) - val (~-) : t -> t (** @since NEXT_RELEASE *) - val ( * ) : t -> t -> t (** @since NEXT_RELEASE *) - val (/) : t -> t -> t (** @since NEXT_RELEASE *) - val (mod) : t -> t -> t (** @since NEXT_RELEASE *) - val (land) : t -> t -> t (** @since NEXT_RELEASE *) - val (lor) : t -> t -> t (** @since NEXT_RELEASE *) - val (lxor) : t -> t -> t (** @since NEXT_RELEASE *) - val lnot : t -> t (** @since NEXT_RELEASE *) - val (lsl) : t -> int -> t (** @since NEXT_RELEASE *) - val (lsr) : t -> int -> t (** @since NEXT_RELEASE *) - val (asr) : t -> int -> t (** @since NEXT_RELEASE *) + val (+) : t -> t -> t (** @since 2.1 *) + val (-) : t -> t -> t (** @since 2.1 *) + val (~-) : t -> t (** @since 2.1 *) + val ( * ) : t -> t -> t (** @since 2.1 *) + val (/) : t -> t -> t (** @since 2.1 *) + val (mod) : t -> t -> t (** @since 2.1 *) + val (land) : t -> t -> t (** @since 2.1 *) + val (lor) : t -> t -> t (** @since 2.1 *) + val (lxor) : t -> t -> t (** @since 2.1 *) + val lnot : t -> t (** @since 2.1 *) + val (lsl) : t -> int -> t (** @since 2.1 *) + val (lsr) : t -> int -> t (** @since 2.1 *) + val (asr) : t -> int -> t (** @since 2.1 *) end include module type of Infix diff --git a/src/core/CCInt32.mli b/src/core/CCInt32.mli index 1386abf1..33a0cfab 100644 --- a/src/core/CCInt32.mli +++ b/src/core/CCInt32.mli @@ -13,7 +13,7 @@ of type int, and arithmetic operations on int32 are generally slower than those on int. Use int32 only when the application requires exact 32-bit arithmetic. - @since NEXT_RELEASE *) + @since 2.1 *) include module type of struct include Int32 end diff --git a/src/core/CCInt64.mli b/src/core/CCInt64.mli index faf58cd8..a6b31951 100644 --- a/src/core/CCInt64.mli +++ b/src/core/CCInt64.mli @@ -67,7 +67,7 @@ val (asr) : t -> int -> t The result is unspecified if [y < 0] or [y >= 64]. *) (** Infix operators - @since NEXT_RELEASE *) + @since 2.1 *) module Infix : sig val (+) : t -> t -> t val (-) : t -> t -> t @@ -119,7 +119,7 @@ val of_int : int -> t val of_int_exn : int -> t (** Alias to {!Int64.of_int}. - @deprecated since NEXT_RELEASE *) + @deprecated since 2.1 *) val to_int32 : t -> int32 (** Convert the given 64-bit integer (type [int64]) to a @@ -133,7 +133,7 @@ val of_int32 : int32 -> t val of_int32_exn : int32 -> t (** Alias to {!Int64.of_int32}. - @deprecated since NEXT_RELEASE *) + @deprecated since 2.1 *) val to_nativeint : t -> nativeint (** Convert the given 64-bit integer (type [int64]) to a @@ -147,7 +147,7 @@ val of_nativeint : nativeint -> t val of_nativeint_exn : nativeint -> t (** Alias to {!Int64.of_nativeint}. - @deprecated since NEXT_RELEASE *) + @deprecated since 2.1 *) val to_float : t -> float (** Convert the given 64-bit integer to a floating-point number. *) @@ -162,7 +162,7 @@ val of_float : float -> t val of_float_exn : float -> t (** Alias to {!Int64.of_float}. - @deprecated since NEXT_RELEASE *) + @deprecated since 2.1 *) val to_string : t -> string (** Return the string representation of its argument, in decimal. *) @@ -172,7 +172,7 @@ val of_string : string -> t option val of_string_opt : string -> t option (** Alias to {!of_string}. - @since NEXT_RELEASE *) + @since 2.1 *) val of_string_exn : string -> t (** Alias to {!Int64.of_string}. diff --git a/src/core/CCList.mli b/src/core/CCList.mli index 2b8261c5..ddaa6eab 100644 --- a/src/core/CCList.mli +++ b/src/core/CCList.mli @@ -204,12 +204,12 @@ val sublists_of_len : val intersperse : 'a -> 'a list -> 'a list (** Insert the first argument between every element of the list - @since NEXT_RELEASE *) + @since 2.1 *) val interleave : 'a list -> 'a list -> 'a list (** [interleave [x1…xn] [y1…ym]] is [x1,y1,x2,y2,…] and finishes with the suffix of the longest list - @since NEXT_RELEASE *) + @since 2.1 *) val pure : 'a -> 'a t (** [pure] is [return]. *) diff --git a/src/core/CCNativeint.mli b/src/core/CCNativeint.mli index f1754e30..47930754 100644 --- a/src/core/CCNativeint.mli +++ b/src/core/CCNativeint.mli @@ -14,7 +14,7 @@ and arithmetic operations on [nativeint] are generally slower than those on [int]. Use [nativeint] only when the application requires the extra bit of precision over the [int] type. - @since NEXT_RELEASE *) + @since 2.1 *) include module type of struct include Nativeint end diff --git a/src/core/CCUtf8_string.mli b/src/core/CCUtf8_string.mli index 4db382be..da6caae6 100644 --- a/src/core/CCUtf8_string.mli +++ b/src/core/CCUtf8_string.mli @@ -10,7 +10,7 @@ For more elaborate operations, please use the excellent {{: http://erratique.ch/software/uutf} Uutf}. - @since NEXT_RELEASE + @since 2.1 {b status}: experimental *) diff --git a/src/data/CCBijection.mli b/src/data/CCBijection.mli index 996633c4..1c39d41e 100644 --- a/src/data/CCBijection.mli +++ b/src/data/CCBijection.mli @@ -4,7 +4,7 @@ Represents 1-to-1 mappings between two types. Each element from the "left" is mapped to one "right" value, and conversely. - @since NEXT_RELEASE *) + @since 2.1 *) type 'a sequence = ('a -> unit) -> unit diff --git a/src/data/CCFun_vec.mli b/src/data/CCFun_vec.mli index b6389000..76f907f3 100644 --- a/src/data/CCFun_vec.mli +++ b/src/data/CCFun_vec.mli @@ -7,7 +7,7 @@ {b status: experimental. DO NOT USE (yet)} - @since NEXT_RELEASE + @since 2.1 *) type 'a sequence = ('a -> unit) -> unit diff --git a/src/iter/CCLazy_list.mli b/src/iter/CCLazy_list.mli index fae64d50..95eb3c3e 100644 --- a/src/iter/CCLazy_list.mli +++ b/src/iter/CCLazy_list.mli @@ -47,12 +47,12 @@ val flat_map : f:('a -> 'b t) -> 'a t -> 'b t val default : default:'a t -> 'a t -> 'a t (** Choice operator. - @since NEXT_RELEASE *) + @since 2.1 *) module Infix : sig val (>|=) : 'a t -> ('a -> 'b) -> 'b t val (>>=) : 'a t -> ('a -> 'b t) -> 'b t - val (<|>) : 'a t -> 'a t -> 'a t (** Alias to {!default}. @since NEXT_RELEASE *) + val (<|>) : 'a t -> 'a t -> 'a t (** Alias to {!default}. @since 2.1 *) end include module type of Infix diff --git a/src/monomorphic/CCMonomorphic.mli b/src/monomorphic/CCMonomorphic.mli index a188c82b..6b19e49f 100644 --- a/src/monomorphic/CCMonomorphic.mli +++ b/src/monomorphic/CCMonomorphic.mli @@ -17,23 +17,23 @@ val max : int -> int -> int (** {2 Infix operators for Floats} *) -val (=.) : float -> float -> bool (** @since NEXT_RELEASE *) +val (=.) : float -> float -> bool (** @since 2.1 *) -val (<>.) : float -> float -> bool (** @since NEXT_RELEASE *) +val (<>.) : float -> float -> bool (** @since 2.1 *) -val (<.) : float -> float -> bool (** @since NEXT_RELEASE *) +val (<.) : float -> float -> bool (** @since 2.1 *) -val (>.) : float -> float -> bool (** @since NEXT_RELEASE *) +val (>.) : float -> float -> bool (** @since 2.1 *) -val (<=.) : float -> float -> bool (** @since NEXT_RELEASE *) +val (<=.) : float -> float -> bool (** @since 2.1 *) -val (>=.) : float -> float -> bool (** @since NEXT_RELEASE *) +val (>=.) : float -> float -> bool (** @since 2.1 *) (** {2 Shadow Dangerous Operators} *) val (==) : [`Consider_using_CCEqual_physical] [@@ocaml.deprecated "Please use CCEqual.physical or Pervasives.(==) instead."] -(** @since NEXT_RELEASE *) +(** @since 2.1 *) val (!=) : [`Consider_using_CCEqual_physical] [@@ocaml.deprecated "Please use [not CCEqual.physical] or Pervasives.(!=) instead."]