mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
prepare for 1.3
This commit is contained in:
parent
acb286d8e8
commit
bedf9ecc1e
10 changed files with 38 additions and 20 deletions
|
|
@ -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)
|
||||
|
|
|
|||
2
_oasis
2
_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
|
||||
|
|
|
|||
|
|
@ -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],
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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 *)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 *)
|
||||
|
|
|
|||
|
|
@ -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 *)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue