prepare for 1.5

This commit is contained in:
Simon Cruanes 2018-01-02 18:14:32 +01:00
parent 7f6cb0f673
commit 18c9f88411
13 changed files with 68 additions and 46 deletions

View file

@ -1,5 +1,27 @@
= Changelog
== 1.5
- have `CCList.{get,insert,set}_at_idx` work with negative indices
- Add CCCache.add
- missing function in `CCListLabels`
- Allow negative indexes in CCList.remove_at_idx
- add an optional `drop` parameter to string-splitting functions
- add `Hash.const0` for trivial hash function that ignores its input
- improve compatibility with the stdlib
- Add List.count
- Add String.is_empty
- add missing compatibility functions: `{assoc_opt,assq_opt}`
- backport some functions added in 4.05 in `CCList`
- add functions from 4.05 into `CC{Map,Set}`
- Implement `CCImmutArray.sub`
- bugfix in `CCTrie.Make`: Remove polymorphic comparison
- remove dependency on cppo
- add travis support
- update doc of `CCList.cartesian_product`, which returns results in unspecified order (close #154)
- fix containers.top (closes #155)
== 1.4
- add `CCMap.union`

2
_oasis
View file

@ -1,6 +1,6 @@
OASISFormat: 0.4
Name: containers
Version: 1.4
Version: 1.5
Homepage: https://github.com/c-cube/ocaml-containers
Authors: Simon Cruanes
License: BSD-2-clause

View file

@ -18,7 +18,7 @@ val const0 : _ t
(** Always return 0. Useful for ignoring elements.
Example: [Hash.(pair string const0)] will map pairs [("a", 1)]
and [("a", 2)] to the same hash, but not the same as [("b", 1)]
@since NEXT_RELEASE *)
@since 1.5 *)
val int : int t
val bool : bool t

View file

@ -78,7 +78,7 @@ val fold_flat_map : ('acc -> 'a -> 'acc * 'b list) -> 'acc -> 'a list -> 'acc *
val count : ('a -> bool) -> 'a list -> int
(** [count f l] counts how much element of [l] comply with the function [f].
@since NEXT_RELEASE *)
@since 1.5 *)
val init : int -> (int -> 'a) -> 'a t
(** Similar to {!Array.init}
@ -103,11 +103,11 @@ val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val compare_lengths : 'a t -> 'b t -> int
(** equivalent to [compare (length l1) (length l2)] but more efficient.
@since NEXT_RELEASE *)
@since 1.5 *)
val compare_length_with : 'a t -> int -> int
(** equivalent to [compare (length l) x] but more efficient.
@since NEXT_RELEASE *)
@since 1.5 *)
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
@ -239,7 +239,7 @@ val find_pred : ('a -> bool) -> 'a t -> 'a option
val find_opt : ('a -> bool) -> 'a t -> 'a option
(** Safe version of {!find}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_pred_exn : ('a -> bool) -> 'a t -> 'a
(** Unsafe version of {!find_pred}
@ -346,7 +346,7 @@ val get_at_idx : int -> 'a t -> 'a option
val nth_opt : 'a t -> int -> 'a option
(** Safe version of {!nth}.
@raise Invalid_argument if the int is negative.
@since NEXT_RELEASE *)
@since 1.5 *)
val get_at_idx_exn : int -> 'a t -> 'a
(** Get the i-th element, or
@ -466,11 +466,11 @@ end
val assoc_opt : 'a -> ('a * 'b) t -> 'b option
(** Safe version of {!assoc}
@since NEXT_RELEASE *)
@since 1.5 *)
val assq_opt : 'a -> ('a * 'b) t -> 'b option
(** Safe version of {!assq}
@since NEXT_RELEASE *)
@since 1.5 *)
(** {2 References on Lists}
@since 0.3.3 *)

View file

@ -109,7 +109,7 @@ val sublists_of_len :
See {!CCList.sublists_of_len} for more details.
@since NEXT_RELEASE *)
@since 1.5 *)
val pure : 'a -> 'a t

View file

@ -27,28 +27,28 @@ module type S = sig
val choose_opt : 'a t -> (key * 'a) option
(** Safe version of {!choose}
@since NEXT_RELEASE *)
@since 1.5 *)
val min_binding_opt : 'a t -> (key * 'a) option
(** Safe version of {!min_binding}
@since NEXT_RELEASE *)
@since 1.5 *)
val max_binding_opt : 'a t -> (key * 'a) option
(** Safe version of {!max_binding}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_opt : key -> 'a t -> 'a option
(** Safe version of {!find}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_first : (key -> bool) -> 'a t -> key * 'a
(** Find smallest binding satisfying the monotonic predicate.
See {!Map.S.find_first}.
@since NEXT_RELEASE *)
@since 1.5 *)
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
(** Safe version of {!find_first}
@since NEXT_RELEASE *)
@since 1.5 *)
val merge_safe :
f:(key -> [`Left of 'a | `Right of 'b | `Both of 'a * 'b] -> 'c option) ->

View file

@ -10,7 +10,7 @@ type 'a sequence = ('a -> unit) -> unit
type 'a printer = Format.formatter -> 'a -> unit
module type OrderedType = Map.OrderedType
(** @since NEXT_RELEASE *)
(** @since 1.5 *)
module type S = sig
include Map.S
@ -31,28 +31,28 @@ module type S = sig
val choose_opt : 'a t -> (key * 'a) option
(** Safe version of {!choose}
@since NEXT_RELEASE *)
@since 1.5 *)
val min_binding_opt : 'a t -> (key * 'a) option
(** Safe version of {!min_binding}
@since NEXT_RELEASE *)
@since 1.5 *)
val max_binding_opt : 'a t -> (key * 'a) option
(** Safe version of {!max_binding}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_opt : key -> 'a t -> 'a option
(** Safe version of {!find}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_first : (key -> bool) -> 'a t -> key * 'a
(** Find smallest binding satisfying the monotonic predicate.
See {!Map.S.find_first}.
@since NEXT_RELEASE *)
@since 1.5 *)
val find_first_opt : (key -> bool) -> 'a t -> (key * 'a) option
(** Safe version of {!find_first}
@since NEXT_RELEASE *)
@since 1.5 *)
val merge_safe :
f:(key -> [`Left of 'a | `Right of 'b | `Both of 'a * 'b] -> 'c option) ->

View file

@ -15,7 +15,7 @@ type 'a printer = Format.formatter -> 'a -> unit
(** {2 Basics} *)
include module type of Result
(** @since NEXT_RELEASE *)
(** @since 1.5 *)
type (+'good, +'bad) t = ('good, 'bad) Result.result =
| Ok of 'good

View file

@ -13,35 +13,35 @@ module type S = sig
val min_elt_opt : t -> elt option
(** Safe version of {!min_elt}
@since NEXT_RELEASE *)
@since 1.5 *)
val max_elt_opt : t -> elt option
(** Safe version of {!max_elt}
@since NEXT_RELEASE *)
@since 1.5 *)
val choose_opt : t -> elt option
(** Safe version of {!choose}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_opt : elt -> t -> elt option
(** Safe version of {!find}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_first : (elt -> bool) -> t -> elt
(** Find minimum element satisfying predicate
@since NEXT_RELEASE *)
@since 1.5 *)
val find_first_opt : (elt -> bool) -> t -> elt option
(** Safe version of {!find_first}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_last : (elt -> bool) -> t -> elt
(** Find maximum element satisfying predicate
@since NEXT_RELEASE *)
@since 1.5 *)
val find_last_opt : (elt -> bool) -> t -> elt option
(** Safe version of {!find_last}
@since NEXT_RELEASE *)
@since 1.5 *)
val of_seq : elt sequence -> t

View file

@ -9,42 +9,42 @@ type 'a sequence = ('a -> unit) -> unit
type 'a printer = Format.formatter -> 'a -> unit
module type OrderedType = Set.OrderedType
(** @since NEXT_RELEASE *)
(** @since 1.5 *)
module type S = sig
include Set.S
val min_elt_opt : t -> elt option
(** Safe version of {!min_elt}
@since NEXT_RELEASE *)
@since 1.5 *)
val max_elt_opt : t -> elt option
(** Safe version of {!max_elt}
@since NEXT_RELEASE *)
@since 1.5 *)
val choose_opt : t -> elt option
(** Safe version of {!choose}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_opt : elt -> t -> elt option
(** Safe version of {!find}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_first : (elt -> bool) -> t -> elt
(** Find minimum element satisfying predicate
@since NEXT_RELEASE *)
@since 1.5 *)
val find_first_opt : (elt -> bool) -> t -> elt option
(** Safe version of {!find_first}
@since NEXT_RELEASE *)
@since 1.5 *)
val find_last : (elt -> bool) -> t -> elt
(** Find maximum element satisfying predicate
@since NEXT_RELEASE *)
@since 1.5 *)
val find_last_opt : (elt -> bool) -> t -> elt option
(** Safe version of {!find_last}
@since NEXT_RELEASE *)
@since 1.5 *)
val of_seq : elt sequence -> t

View file

@ -55,7 +55,7 @@ val equal : string -> string -> bool
val compare : string -> string -> int
val is_empty : string -> bool
(** @since NEXT_RELEASE *)
(** @since 1.5 *)
val hash : string -> int
@ -504,7 +504,7 @@ module Split : sig
- [{first=true; last=true}] will return ["a"; "b"]
The default value of all remaining functions is [Drop_none].
@since NEXT_RELEASE
@since 1.5
*)
type drop_if_empty = {
first: bool;
@ -513,7 +513,7 @@ module Split : sig
val no_drop : drop_if_empty
(** Do not drop any group, even empty and on borders
@since NEXT_RELEASE *)
@since 1.5 *)
val list_ : ?drop:drop_if_empty -> by:string -> string -> (string*int*int) list
(** Eplit the given string along the given separator [by]. Should only

View file

@ -74,7 +74,7 @@ val iter : ('a,'b) t -> ('a -> 'b -> unit) -> unit
val add : ('a, 'b) t -> 'a -> 'b -> bool
(** Manually add a cached value. Returns [true] if the value has succesfully
been added, and [false] if the value was already bound.
@since NEXT_RELEASE *)
@since 1.5 *)
val dummy : ('a,'b) t
(** Dummy cache, never stores any value *)

View file

@ -43,7 +43,7 @@ val sub : 'a t -> int -> int -> 'a t
Raises [Invalid_argument "Array.sub"] if [start] and [len] do not designate a
valid subarray of a; that is, if start < 0, or len < 0, or start + len > Array.length a.
@since NEXT_RELEASE *)
@since 1.5 *)
val map : ('a -> 'b) -> 'a t -> 'b t