diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 9a36f8c5..92ce2c9d 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -1,5 +1,23 @@ = Changelog +== 1.3 + +- deprecate `CCBool.negate` +- add `CCString.compare_natural` (closes #146) +- add callbacks in `CCCache.with_cache{,_rec}` (closes #140) +- tail-rec `CCList.split` (by @bikalgurung, see #138) +- change `CCRingBuffer.peek_{front,back}` to return options (closes #127) +- add `CCRingBuffer.is_full` +- add `CCArray.find_map{,_i}`, deprecated older names (closes #129) +- add `CCList.{keep,all}_{some,ok}` (closes #124) +- large refactor of `CCSimple_queue` (close #125) +- add `CCSimple_queue` to containers.data +- small change for consistency in `CCIntMap` + +- bugfix in `CCRingBuffer.skip`, and corresponding tests +- cleanup and refactor of `CCRingBuffer` (see #126). Add strong tests. +- add rich testsuite to `CCIntMap`, based on @jmid's work + == 1.2 - make many modules extensions of stdlib (close #109) diff --git a/_oasis b/_oasis index 550ef65f..7547035f 100644 --- a/_oasis +++ b/_oasis @@ -1,6 +1,6 @@ OASISFormat: 0.4 Name: containers -Version: 1.2 +Version: 1.3 Homepage: https://github.com/c-cube/ocaml-containers Authors: Simon Cruanes License: BSD-2-clause diff --git a/src/core/CCArray.mli b/src/core/CCArray.mli index 8bbe8498..4511a56b 100644 --- a/src/core/CCArray.mli +++ b/src/core/CCArray.mli @@ -94,21 +94,21 @@ val sort_ranking : ('a -> 'a -> int) -> 'a t -> int array val find_map : ('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 1.3 *) val find : ('a -> 'b option) -> 'a t -> 'b option (** Alias to {!find_map} - @deprecated since NEXT_RELEASE *) + @deprecated since 1.3 *) val find_map_i : (int -> 'a -> 'b option) -> 'a t -> 'b option (** Like {!find_map}, but also pass the index to the predicate function. - @since NEXT_RELEASE *) + @since 1.3 *) val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option (** Alias to {!find_map_i} @since 0.3.4 - @deprecated since NEXT_RELEASE *) + @deprecated since 1.3 *) val find_idx : ('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/CCBool.mli b/src/core/CCBool.mli index 624b53d3..ad512f11 100644 --- a/src/core/CCBool.mli +++ b/src/core/CCBool.mli @@ -12,7 +12,7 @@ val equal : t -> t -> bool val negate : t -> t (** Negation on booleans (functional version of [not]) - @deprecate since NEXT_RELEASE, simply use {!not} instead *) + @deprecate since 1.3, simply use {!not} instead *) type 'a printer = Format.formatter -> 'a -> unit diff --git a/src/core/CCList.mli b/src/core/CCList.mli index c7407f3e..710dadc8 100644 --- a/src/core/CCList.mli +++ b/src/core/CCList.mli @@ -253,22 +253,22 @@ val filter_map : ('a -> 'b option) -> 'a t -> 'b t val keep_some : 'a option t -> 'a t (** [filter_some l] retains only elements of the form [Some x]. Same as [filter_map CCFun.id] - @since NEXT_RELEASE *) + @since 1.3 *) val keep_ok : ('a, _) Result.result t -> 'a t (** [filter_some l] retains only elements of the form [Some x]. Same as [filter_map CCFun.id] - @since NEXT_RELEASE *) + @since 1.3 *) val all_some : 'a option t -> 'a t option (** [all_some l] returns [Some l'] if all elements of [l] are of the form [Some x], or [None] otherwise. - @since NEXT_RELEASE *) + @since 1.3 *) val all_ok : ('a, 'err) Result.result t -> ('a t, 'err) Result.result (** [all_ok l] returns [Ok l'] if all elements of [l] are of the form [Ok x], or [Error e] otherwise (with the first error met). - @since NEXT_RELEASE *) + @since 1.3 *) val sorted_merge : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list (** Merges elements from both sorted list *) diff --git a/src/core/CCString.mli b/src/core/CCString.mli index 996873b4..3d61b5b1 100644 --- a/src/core/CCString.mli +++ b/src/core/CCString.mli @@ -581,7 +581,7 @@ val compare_versions : string -> string -> int val compare_natural : string -> string -> int (** Natural Sort Order, comparing chunks of digits as natural numbers. https://en.wikipedia.org/wiki/Natural_sort_order - @since NEXT_RELEASE *) + @since 1.3 *) (*$T compare_natural "foo1" "foo2" < 0 diff --git a/src/data/CCCache.mli b/src/data/CCCache.mli index a5ccc2ce..1caac2ed 100644 --- a/src/data/CCCache.mli +++ b/src/data/CCCache.mli @@ -37,7 +37,7 @@ type ('a, 'b) callback = in_cache:bool -> 'a -> 'b -> unit Should never raise. @param in_cache is [true] if the value was in cache, [false] if the value was just produced. - @since NEXT_RELEASE *) + @since 1.3 *) val with_cache : ?cb:('a, 'b) callback -> ('a, 'b) t -> ('a -> 'b) -> 'a -> 'b (** [with_cache c f] behaves like [f], but caches calls to [f] in the diff --git a/src/data/CCRingBuffer.ml b/src/data/CCRingBuffer.ml index 0d344bef..af64a188 100644 --- a/src/data/CCRingBuffer.ml +++ b/src/data/CCRingBuffer.ml @@ -94,7 +94,7 @@ module type S = sig val is_full : t -> bool (** true if pushing an element would erase another element. - @since NEXT_RELEASE *) + @since 1.3 *) val blit_from : t -> Array.t -> int -> int -> unit (** [blit_from buf from_buf o len] copies the slice [o, ... o + len - 1] from @@ -162,7 +162,7 @@ module type S = sig val peek_front_exn : t -> Array.elt (** First value from front of [t], without modification. @raise Empty if buffer is empty. - @since NEXT_RELEASE *) + @since 1.3 *) val peek_back : t -> Array.elt option (** Get the last value from back of [t], without modification. *) @@ -170,7 +170,7 @@ module type S = sig val peek_back_exn : t -> Array.elt (** Get the last value from back of [t], without modification. @raise Empty if buffer is empty. - @since NEXT_RELEASE *) + @since 1.3 *) val take_back : t -> Array.elt option (** Take and remove the last value from back of [t], if any *) diff --git a/src/data/CCRingBuffer.mli b/src/data/CCRingBuffer.mli index c5b81d71..5e24ea5b 100644 --- a/src/data/CCRingBuffer.mli +++ b/src/data/CCRingBuffer.mli @@ -13,7 +13,7 @@ @since 0.9 Change in the API to provide only a bounded buffer - @since NEXT_RELEASE + @since 1.3 *) (** {2 Underlying Array} *) @@ -95,7 +95,7 @@ module type S = sig val is_full : t -> bool (** true if pushing an element would erase another element. - @since NEXT_RELEASE *) + @since 1.3 *) val blit_from : t -> Array.t -> int -> int -> unit (** [blit_from buf from_buf o len] copies the slice [o, ... o + len - 1] from @@ -163,7 +163,7 @@ module type S = sig val peek_front_exn : t -> Array.elt (** First value from front of [t], without modification. @raise Empty if buffer is empty. - @since NEXT_RELEASE *) + @since 1.3 *) val peek_back : t -> Array.elt option (** Get the last value from back of [t], without modification. *) @@ -171,7 +171,7 @@ module type S = sig val peek_back_exn : t -> Array.elt (** Get the last value from back of [t], without modification. @raise Empty if buffer is empty. - @since NEXT_RELEASE *) + @since 1.3 *) val take_back : t -> Array.elt option (** Take and remove the last value from back of [t], if any *) diff --git a/src/data/CCSimple_queue.mli b/src/data/CCSimple_queue.mli index 35dc801b..5b2bbcf1 100644 --- a/src/data/CCSimple_queue.mli +++ b/src/data/CCSimple_queue.mli @@ -4,7 +4,7 @@ (** {1 Functional queues (fifo)} *) (** Simple implementation of functional queues - @since NEXT_RELEASE *) + @since 1.3 *) type 'a sequence = ('a -> unit) -> unit type 'a printer = Format.formatter -> 'a -> unit