prepare for 2.1

This commit is contained in:
Simon Cruanes 2018-03-28 20:26:17 -05:00
parent c04ee13d6e
commit 6e50ff41c6
17 changed files with 79 additions and 51 deletions

View file

@ -1,5 +1,33 @@
= Changelog = 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 == 2.0
=== breaking === breaking

View file

@ -1,6 +1,6 @@
opam-version: "1.2" opam-version: "1.2"
name: "containers" name: "containers"
version: "2.0" version: "2.1"
author: "Simon Cruanes" author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org" maintainer: "simon.cruanes.2007@m4x.org"
build: [ build: [

View file

@ -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 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 (** [fold_map f acc a] is a [fold_left]-like function, but it also maps the
array to another array. array to another array.
@since NEXT_RELEASE *) @since 2.1 *)
val scan_left : f:('acc -> 'a -> 'acc) -> init:'acc -> 'a t -> 'acc t val scan_left : f:('acc -> 'a -> 'acc) -> init:'acc -> 'a t -> 'acc t
(** [scan_left f acc a] returns the array (** [scan_left f acc a] returns the array
[ [|acc; f acc x0; f (f acc a.(0)) a.(1); |] ]. [ [|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 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 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 (** [find_map f a] returns [Some y] if there is an element [x] such
that [f x = Some y], else it returns [None]. 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 val find : f:('a -> 'b option) -> 'a t -> 'b option
(** [find f a] returns [Some y] if there is an element [x] such (** [find f a] returns [Some y] if there is an element [x] such
that [f x = Some y], else it returns [None]. 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 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. (** 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 val findi : f:(int -> 'a -> 'b option) -> 'a t -> 'b option
(** Like {!find}, but also pass the index to the predicate function. (** Like {!find}, but also pass the index to the predicate function.
@since 0.3.4 @since 0.3.4
@deprecated since NEXT_RELEASE *) @deprecated since 2.1 *)
val find_idx : f:('a -> bool) -> 'a t -> (int * 'a) option 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], (** [find_idx p x] returns [Some (i,x)] where [x] is the [i]-th element of [l],

View file

@ -132,19 +132,19 @@ module Infix : sig
(** @since 0.17 *) (** @since 0.17 *)
val (+) : t -> t -> t val (+) : t -> t -> t
(** Addition. @since NEXT_RELEASE *) (** Addition. @since 2.1 *)
val (-) : t -> t -> t val (-) : t -> t -> t
(** Subtraction. @since NEXT_RELEASE *) (** Subtraction. @since 2.1 *)
val (~-) : t -> t val (~-) : t -> t
(** Unary negation. @since NEXT_RELEASE *) (** Unary negation. @since 2.1 *)
val ( * ) : t -> t -> t val ( * ) : t -> t -> t
(** Multiplication. @since NEXT_RELEASE *) (** Multiplication. @since 2.1 *)
val (/) : t -> t -> t val (/) : t -> t -> t
(** Division. @since NEXT_RELEASE *) (** Division. @since 2.1 *)
end end
include module type of Infix include module type of Infix

View file

@ -286,7 +286,7 @@ val ksprintf :
'a 'a
(** [ksprintf fmt ~f] formats using [fmt], in a way similar to {!sprintf}, (** [ksprintf fmt ~f] formats using [fmt], in a way similar to {!sprintf},
and then calls [f] on the resulting string. 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 *) @since 0.14 *)
val to_file : string -> ('a, t, unit, unit) format4 -> 'a val to_file : string -> ('a, t, unit, unit) format4 -> 'a

View file

@ -79,7 +79,7 @@ val opaque_identity : 'a -> 'a
val iterate : int -> ('a -> 'a) -> '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 (** [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. [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} (** {2 Monad}

View file

@ -65,10 +65,10 @@ val combine3 : hash -> hash -> hash -> hash
val combine4 : hash -> hash -> hash -> hash -> hash val combine4 : hash -> hash -> hash -> hash -> hash
val combine5 : hash -> 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 val combine6 : hash -> hash -> hash -> hash -> hash -> hash -> hash
(** @since NEXT_RELEASE *) (** @since 2.1 *)
(** {2 Iterators} *) (** {2 Iterators} *)

View file

@ -116,19 +116,19 @@ module Infix : sig
(** Alias to {!range'}. (** Alias to {!range'}.
@since 1.2 *) @since 1.2 *)
val (+) : t -> t -> t (** @since NEXT_RELEASE *) val (+) : t -> t -> t (** @since 2.1 *)
val (-) : t -> t -> t (** @since NEXT_RELEASE *) val (-) : t -> t -> t (** @since 2.1 *)
val (~-) : t -> t (** @since NEXT_RELEASE *) val (~-) : t -> t (** @since 2.1 *)
val ( * ) : t -> t -> t (** @since NEXT_RELEASE *) val ( * ) : t -> t -> t (** @since 2.1 *)
val (/) : t -> t -> t (** @since NEXT_RELEASE *) val (/) : t -> t -> t (** @since 2.1 *)
val (mod) : t -> t -> t (** @since NEXT_RELEASE *) val (mod) : t -> t -> t (** @since 2.1 *)
val (land) : t -> t -> t (** @since NEXT_RELEASE *) val (land) : t -> t -> t (** @since 2.1 *)
val (lor) : t -> t -> t (** @since NEXT_RELEASE *) val (lor) : t -> t -> t (** @since 2.1 *)
val (lxor) : t -> t -> t (** @since NEXT_RELEASE *) val (lxor) : t -> t -> t (** @since 2.1 *)
val lnot : t -> t (** @since NEXT_RELEASE *) val lnot : t -> t (** @since 2.1 *)
val (lsl) : t -> int -> t (** @since NEXT_RELEASE *) val (lsl) : t -> int -> t (** @since 2.1 *)
val (lsr) : t -> int -> t (** @since NEXT_RELEASE *) val (lsr) : t -> int -> t (** @since 2.1 *)
val (asr) : t -> int -> t (** @since NEXT_RELEASE *) val (asr) : t -> int -> t (** @since 2.1 *)
end end
include module type of Infix include module type of Infix

View file

@ -13,7 +13,7 @@
of type int, and arithmetic operations on int32 are generally slower than 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. 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 include module type of struct include Int32 end

View file

@ -67,7 +67,7 @@ val (asr) : t -> int -> t
The result is unspecified if [y < 0] or [y >= 64]. *) The result is unspecified if [y < 0] or [y >= 64]. *)
(** Infix operators (** Infix operators
@since NEXT_RELEASE *) @since 2.1 *)
module Infix : sig module Infix : sig
val (+) : t -> t -> t val (+) : t -> t -> t
val (-) : t -> t -> t val (-) : t -> t -> t
@ -119,7 +119,7 @@ val of_int : int -> t
val of_int_exn : int -> t val of_int_exn : int -> t
(** Alias to {!Int64.of_int}. (** Alias to {!Int64.of_int}.
@deprecated since NEXT_RELEASE *) @deprecated since 2.1 *)
val to_int32 : t -> int32 val to_int32 : t -> int32
(** Convert the given 64-bit integer (type [int64]) to a (** 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 val of_int32_exn : int32 -> t
(** Alias to {!Int64.of_int32}. (** Alias to {!Int64.of_int32}.
@deprecated since NEXT_RELEASE *) @deprecated since 2.1 *)
val to_nativeint : t -> nativeint val to_nativeint : t -> nativeint
(** Convert the given 64-bit integer (type [int64]) to a (** 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 val of_nativeint_exn : nativeint -> t
(** Alias to {!Int64.of_nativeint}. (** Alias to {!Int64.of_nativeint}.
@deprecated since NEXT_RELEASE *) @deprecated since 2.1 *)
val to_float : t -> float val to_float : t -> float
(** Convert the given 64-bit integer to a floating-point number. *) (** 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 val of_float_exn : float -> t
(** Alias to {!Int64.of_float}. (** Alias to {!Int64.of_float}.
@deprecated since NEXT_RELEASE *) @deprecated since 2.1 *)
val to_string : t -> string val to_string : t -> string
(** Return the string representation of its argument, in decimal. *) (** 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 val of_string_opt : string -> t option
(** Alias to {!of_string}. (** Alias to {!of_string}.
@since NEXT_RELEASE *) @since 2.1 *)
val of_string_exn : string -> t val of_string_exn : string -> t
(** Alias to {!Int64.of_string}. (** Alias to {!Int64.of_string}.

View file

@ -204,12 +204,12 @@ val sublists_of_len :
val intersperse : 'a -> 'a list -> 'a list val intersperse : 'a -> 'a list -> 'a list
(** Insert the first argument between every element of the 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 val interleave : 'a list -> 'a list -> 'a list
(** [interleave [x1…xn] [y1…ym]] is [x1,y1,x2,y2,…] and finishes with (** [interleave [x1…xn] [y1…ym]] is [x1,y1,x2,y2,…] and finishes with
the suffix of the longest list the suffix of the longest list
@since NEXT_RELEASE *) @since 2.1 *)
val pure : 'a -> 'a t val pure : 'a -> 'a t
(** [pure] is [return]. *) (** [pure] is [return]. *)

View file

@ -14,7 +14,7 @@
and arithmetic operations on [nativeint] are generally slower than those on [int]. 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. 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 include module type of struct include Nativeint end

View file

@ -10,7 +10,7 @@
For more elaborate operations, For more elaborate operations,
please use the excellent {{: http://erratique.ch/software/uutf} Uutf}. please use the excellent {{: http://erratique.ch/software/uutf} Uutf}.
@since NEXT_RELEASE @since 2.1
{b status}: experimental {b status}: experimental
*) *)

View file

@ -4,7 +4,7 @@
Represents 1-to-1 mappings between two types. Each element from the "left" Represents 1-to-1 mappings between two types. Each element from the "left"
is mapped to one "right" value, and conversely. is mapped to one "right" value, and conversely.
@since NEXT_RELEASE *) @since 2.1 *)
type 'a sequence = ('a -> unit) -> unit type 'a sequence = ('a -> unit) -> unit

View file

@ -7,7 +7,7 @@
{b status: experimental. DO NOT USE (yet)} {b status: experimental. DO NOT USE (yet)}
@since NEXT_RELEASE @since 2.1
*) *)
type 'a sequence = ('a -> unit) -> unit type 'a sequence = ('a -> unit) -> unit

View file

@ -47,12 +47,12 @@ val flat_map : f:('a -> 'b t) -> 'a t -> 'b t
val default : default:'a t -> 'a t -> 'a t val default : default:'a t -> 'a t -> 'a t
(** Choice operator. (** Choice operator.
@since NEXT_RELEASE *) @since 2.1 *)
module Infix : sig module Infix : sig
val (>|=) : 'a t -> ('a -> 'b) -> 'b t val (>|=) : 'a t -> ('a -> 'b) -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> '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 end
include module type of Infix include module type of Infix

View file

@ -17,23 +17,23 @@ val max : int -> int -> int
(** {2 Infix operators for Floats} *) (** {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} *) (** {2 Shadow Dangerous Operators} *)
val (==) : [`Consider_using_CCEqual_physical] val (==) : [`Consider_using_CCEqual_physical]
[@@ocaml.deprecated "Please use CCEqual.physical or Pervasives.(==) instead."] [@@ocaml.deprecated "Please use CCEqual.physical or Pervasives.(==) instead."]
(** @since NEXT_RELEASE *) (** @since 2.1 *)
val (!=) : [`Consider_using_CCEqual_physical] val (!=) : [`Consider_using_CCEqual_physical]
[@@ocaml.deprecated "Please use [not CCEqual.physical] or Pervasives.(!=) instead."] [@@ocaml.deprecated "Please use [not CCEqual.physical] or Pervasives.(!=) instead."]