prepare for 3.12

This commit is contained in:
Simon Cruanes 2023-06-01 16:42:05 -04:00
parent e6afa76eaf
commit 81acaaa2cb
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
10 changed files with 38 additions and 25 deletions

View file

@ -1,5 +1,18 @@
# Changelog
## 3.12
- add `containers.pp` sublibrary, with Wadler-style pretty printing combinators
- add `CCArray.{max,argmax,min,argmin}` and their _exn counterparts
- add `CCParse.take_until_success`
- add `Option.flat_map_l`
- add `CCSet.{find_first_map,find_last_map}`
- `CCHash`: native FNV hash for int64/int32
- fix bugs in CCParse related to `recurse` and `Slice`
- fix: fix Set.find_last_map on OCaml 4.03
- fix: make sure `Vector.to_{seq,gen}` captures the length initially
## 3.11
- official OCaml 5 support

View file

@ -1,5 +1,5 @@
opam-version: "2.0"
version: "3.11"
version: "3.12"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
synopsis: "A set of advanced datatypes for containers"

View file

@ -1,5 +1,5 @@
opam-version: "2.0"
version: "3.11"
version: "3.12"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
license: "BSD-2-Clause"

View file

@ -1,6 +1,6 @@
opam-version: "2.0"
name: "containers"
version: "3.11"
version: "3.12"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
license: "BSD-2-Clause"

View file

@ -145,43 +145,43 @@ val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option
val max : ('a -> 'a -> int) -> 'a t -> 'a option
(** [max cmp a] returns [None] if [a] is empty, otherwise, returns [Some e] where [e]
is a maximum element in [a] with respect to [cmp].
@since NEXT_RELEASE *)
@since 3.12 *)
val max_exn : ('a -> 'a -> int) -> 'a t -> 'a
(** [max_exn cmp a] is like {!max}, but
@raise Invalid_argument if [a] is empty.
@since NEXT_RELEASE *)
@since 3.12 *)
val argmax : ('a -> 'a -> int) -> 'a t -> int option
(** [argmax cmp a] returns [None] if [a] is empty, otherwise, returns [Some i] where [i]
is the index of a maximum element in [a] with respect to [cmp].
@since NEXT_RELEASE *)
@since 3.12 *)
val argmax_exn : ('a -> 'a -> int) -> 'a t -> int
(** [argmax_exn cmp a] is like {!argmax}, but
@raise Invalid_argument if [a] is empty.
@since NEXT_RELEASE *)
@since 3.12 *)
val min : ('a -> 'a -> int) -> 'a t -> 'a option
(** [min cmp a] returns [None] if [a] is empty, otherwise, returns [Some e] where [e]
is a minimum element in [a] with respect to [cmp].
@since NEXT_RELEASE *)
@since 3.12 *)
val min_exn : ('a -> 'a -> int) -> 'a t -> 'a
(** [min_exn cmp a] is like {!min}, but
@raise Invalid_argument if [a] is empty.
@since NEXT_RELEASE *)
@since 3.12 *)
val argmin : ('a -> 'a -> int) -> 'a t -> int option
(** [argmin cmp a] returns [None] if [a] is empty, otherwise, returns [Some i] where [i]
is the index of a minimum element in [a] with respect to [cmp].
@since NEXT_RELEASE *)
@since 3.12 *)
val argmin_exn : ('a -> 'a -> int) -> 'a t -> int
(** [argmin_exn cmp a] is like {!argmin}, but
@raise Invalid_argument if [a] is empty.
@since NEXT_RELEASE *)
@since 3.12 *)
val lookup : cmp:'a ord -> 'a -> 'a t -> int option
(** [lookup ~cmp key a] lookups the index of some key [key] in a sorted array [a].

View file

@ -144,43 +144,43 @@ val find_idx : f:('a -> bool) -> 'a t -> (int * 'a) option
val max : cmp:('a -> 'a -> int) -> 'a t -> 'a option
(** [max ~cmp a] returns [None] if [a] is empty, otherwise, returns [Some e] where [e]
is a maximum element in [a] with respect to [cmp].
@since NEXT_RELEASE *)
@since 3.12 *)
val max_exn : cmp:('a -> 'a -> int) -> 'a t -> 'a
(** [max_exn ~cmp a] is like {!max}, but
@raise Invalid_argument if [a] is empty.
@since NEXT_RELEASE *)
@since 3.12 *)
val argmax : cmp:('a -> 'a -> int) -> 'a t -> int option
(** [argmax ~cmp a] returns [None] if [a] is empty, otherwise, returns [Some i] where [i]
is the index of a maximum element in [a] with respect to [cmp].
@since NEXT_RELEASE *)
@since 3.12 *)
val argmax_exn : cmp:('a -> 'a -> int) -> 'a t -> int
(** [argmax_exn ~cmp a] is like {!argmax}, but
@raise Invalid_argument if [a] is empty.
@since NEXT_RELEASE *)
@since 3.12 *)
val min : cmp:('a -> 'a -> int) -> 'a t -> 'a option
(** [min ~cmp a] returns [None] if [a] is empty, otherwise, returns [Some e] where [e]
is a minimum element in [a] with respect to [cmp].
@since NEXT_RELEASE *)
@since 3.12 *)
val min_exn : cmp:('a -> 'a -> int) -> 'a t -> 'a
(** [min_exn ~cmp a] is like {!min}, but
@raise Invalid_argument if [a] is empty.
@since NEXT_RELEASE *)
@since 3.12 *)
val argmin : cmp:('a -> 'a -> int) -> 'a t -> int option
(** [argmin ~cmp a] returns [None] if [a] is empty, otherwise, returns [Some i] where [i]
is the index of a minimum element in [a] with respect to [cmp].
@since NEXT_RELEASE *)
@since 3.12 *)
val argmin_exn : cmp:('a -> 'a -> int) -> 'a t -> int
(** [argmin_exn ~cmp a] is like {!argmin}, but
@raise Invalid_argument if [a] is empty.
@since NEXT_RELEASE *)
@since 3.12 *)
val lookup : cmp:('a ord[@keep_label]) -> key:'a -> 'a t -> int option
(** [lookup ~cmp ~key a] lookups the index of some key [key] in a sorted array [a].

View file

@ -51,7 +51,7 @@ val flat_map : ('a -> 'b t) -> 'a t -> 'b t
val flat_map_l : ('a -> 'b list) -> 'a t -> 'b list
(** [flat_map_l f o] is [[]] if [o] is [None], or [f x] if [o] is [Some x].
@since NEXT_RELEASE *)
@since 3.12 *)
val bind : 'a t -> ('a -> 'b t) -> 'b t
(** [bind o f] is [f v] if [o] is [Some v], [None] otherwise.

View file

@ -310,7 +310,7 @@ val take_until_success : 'a t -> (slice * 'a) t
{b NOTE} performance wise, if [p] does a lot of work at each position,
this can be costly (thing naive substring search if [p] is [string "very long needle"]).
@since NEXT_RELEASE *)
@since 3.12 *)
val take : int -> slice t
(** [take len] parses exactly [len] characters from the input.

View file

@ -37,7 +37,7 @@ module type S = sig
val find_first_map : (elt -> 'a option) -> t -> 'a option
(** [find_first_map f s] find the minimum element [x] of [s] such that [f x = Some y]
and return [Some y]. Otherwise returns [None].
@since NEXT_RELEASE *)
@since 3.12 *)
val find_last : (elt -> bool) -> t -> elt
(** Find maximum element satisfying predicate.
@ -50,7 +50,7 @@ module type S = sig
val find_last_map : (elt -> 'a option) -> t -> 'a option
(** [find_last_map f s] find the maximum element [x] of [s] such that [f x = Some y]
and return [Some y]. Otherwise returns [None].
@since NEXT_RELEASE *)
@since 3.12 *)
val of_iter : elt iter -> t
(** Build a set from the given [iter] of elements.

View file

@ -43,7 +43,7 @@ module type S = sig
val find_first_map : (elt -> 'a option) -> t -> 'a option
(** [find_first_map f s] find the minimum element [x] of [s] such that [f x = Some y]
and return [Some y]. Otherwise returns [None].
@since NEXT_RELEASE *)
@since 3.12 *)
val find_last : (elt -> bool) -> t -> elt
(** Find maximum element satisfying predicate.
@ -56,7 +56,7 @@ module type S = sig
val find_last_map : (elt -> 'a option) -> t -> 'a option
(** [find_last_map f s] find the maximum element [x] of [s] such that [f x = Some y]
and return [Some y]. Otherwise returns [None].
@since NEXT_RELEASE *)
@since 3.12 *)
val of_iter : elt iter -> t
(** Build a set from the given [iter] of elements.