prepare for 3.2

This commit is contained in:
Simon Cruanes 2021-02-01 10:40:28 -05:00
parent f313361df7
commit 0097fd3c3d
12 changed files with 53 additions and 30 deletions

View file

@ -1,5 +1,25 @@
# Changelog
## 3.2
- add CCEither module
- add `CCList.chunks`
- add iter/seq functions to `CCString`
- add `CCList.reduce` (resolves #305)
- fix: in `CCInt` pick popcount at runtime on 64 bits
- fix: in shims, use configurator properly to determine int size
- in `CCFormat`, add `append`, `append_l`, infix `++` for sequencing,
`space`, `break`, `cut`
- fix: in `CCSexp`, handle non-ascii escapes in strings
- `CCUtf8_string`: add and expose `uchar_to_bytes`
- enable auto deploy of doc
- improve CI: test core on non ubuntu platform, test all on ubuntu
- update readme
- CCImmutArray: add tests (#344)
- add fuzzing (#339)
- add stronger test to compare with uutf in ccutf8string
## 3.1
- add `List.combine_chop` and corresponding `(and&)` synchronized product

View file

@ -371,6 +371,8 @@ the library, including printers, maps, etc.
```ocaml
# (|>) ;; (* quick reminder of this awesome standard operator *)
- : 'a -> ('a -> 'b) -> 'b = <fun>
# 10 |> succ;;
- : int = 11
# open CCList.Infix;;
@ -383,7 +385,8 @@ val l : int list =
76; 77; 78; 79; 80; 81; 82; 83; 84; 85; 86; 87; 88; 89; 90; 91; 92; 93;
94; 95; 96; 97; 98; 99; 100]
# l
# (* transform a list, dropping some elements *)
l
|> CCList.filter_map
(fun x-> if x mod 3=0 then Some (float x) else None)
|> CCList.take 5 ;;

View file

@ -1,5 +1,5 @@
opam-version: "2.0"
version: "3.1"
version: "3.2"
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.1"
version: "3.2"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
synopsis: "An extension of containers for threading"

View file

@ -1,6 +1,6 @@
opam-version: "2.0"
name: "containers"
version: "3.1"
version: "3.2"
author: "Simon Cruanes"
maintainer: "simon.cruanes.2007@m4x.org"
synopsis: "A modular, clean and powerful extension of the OCaml standard library"

View file

@ -5,7 +5,7 @@
Module that is compatible with Either form OCaml 4.12 but can be use with any
ocaml version compatible with container
@since NEXT_RELEASE
@since 3.2
*)
type 'a iter = ('a -> unit) -> unit

View file

@ -36,15 +36,15 @@ val exn : exn printer
val space : unit printer
(** Alias to {!pp_print_space}.
@since NEXT_RELEASE *)
@since 3.2 *)
val cut : unit printer
(** Alias to {!pp_print_cut}.
@since NEXT_RELEASE *)
@since 3.2 *)
val break : (int * int) printer
(** Tuple-ized {!printer} form of {!pp_print_break}.
@since NEXT_RELEASE *)
@since 3.2 *)
val newline : unit printer
(** Force newline (see {!Format.pp_force_newline}).
@ -100,11 +100,11 @@ val quad : ?sep:unit printer -> 'a printer -> 'b printer ->
val append : unit printer -> unit printer -> unit printer
(** [append ppa ppb] first prints [ppa ()], then prints [ppb ()].
@since NEXT_RELEASE *)
@since 3.2 *)
val append_l : unit printer list -> unit printer
(** [append_l pps] runs the printers in [pps] sequentially.
@since NEXT_RELEASE *)
@since 3.2 *)
val within : string -> string -> 'a printer -> 'a printer
(** [within a b p] wraps [p] inside the strings [a] and [b]. Convenient,
@ -364,7 +364,7 @@ end
module Infix : sig
val (++) : unit printer -> unit printer -> unit printer
(** Alias to {!append}.
@since NEXT_RELEASE *)
@since 3.2 *)
end
include module type of Infix

View file

@ -84,12 +84,12 @@ val scan_left : ('acc -> 'a -> 'acc) -> 'acc -> 'a list -> 'acc list
val reduce : ('a -> 'a -> 'a) -> 'a list -> 'a option
(** [reduce f (hd::tl)] returns [Some (fold_left f hd tl)]. If [l] is empty,
then [None] is returned.
@since NEXT_RELEASE *)
@since 3.2 *)
val reduce_exn : ('a -> 'a -> 'a) -> 'a list -> 'a
(** [reduce_exn] is the unsafe version of {!reduce}.
@raise Invalid_argument if the given list is empty.
@since NEXT_RELEASE *)
@since 3.2 *)
val fold_map2 : ('acc -> 'a -> 'b -> 'acc * 'c) -> 'acc -> 'a list -> 'b list -> 'acc * 'c list
(** [fold_map2 f init l1 l2] is to [fold_map] what [List.map2] is to [List.map].
@ -328,7 +328,7 @@ val chunks : int -> 'a list -> 'a list list
Each item of [l] will occur in exactly one chunk. Only the last chunk
might be of length smaller than [n].
Invariant: [(chunks n l |> List.flatten) = l].
@since NEXT_RELEASE *)
@since 3.2 *)
val intersperse : 'a -> 'a list -> 'a list
(** [intersperse x l] inserts the element [x] between adjacent elements of the list [l].

View file

@ -88,12 +88,12 @@ val scan_left : f:('acc -> 'a -> 'acc) -> init:'acc -> 'a list -> 'acc list
val reduce : f:('a -> 'a -> 'a) -> 'a list -> 'a option
(** [reduce f (hd::tl)] returns [Some (fold_left f hd tl)]. If [l] is empty,
then [None] is returned.
@since NEXT_RELEASE *)
@since 3.2 *)
val reduce_exn : f:('a -> 'a -> 'a) -> 'a list -> 'a
(** [reduce_exn] is the unsafe version of {!reduce}.
@raise Invalid_argument if the given list is empty.
@since NEXT_RELEASE *)
@since 3.2 *)
val fold_map2 : f:('acc -> 'a -> 'b -> 'acc * 'c) -> init:'acc -> 'a list -> 'b list -> 'acc * 'c list
(** [fold_map2 ~f ~init l1 l2] is to [fold_map] what [List.map2] is to [List.map].
@ -332,7 +332,7 @@ val chunks : int -> 'a list -> 'a list list
Each item of [l] will occur in exactly one chunk. Only the last chunk
might be of length smaller than [n].
Invariant: [(chunks n l |> List.flatten) = l].
@since NEXT_RELEASE *)
@since 3.2 *)
val intersperse : x:'a -> 'a list -> 'a list
(** [intersperse ~x l] inserts the element [x] between adjacent elements of the list [l].

View file

@ -189,11 +189,11 @@ val lines_gen : string -> string gen
val lines_iter : string -> string iter
(** [lines_iter s] returns the [iter] of the lines of [s] (splits along '\n').
@since NEXT_RELEASE *)
@since 3.2 *)
val lines_seq : string -> string Seq.t
(** [lines_seq s] returns the [Seq.t] of the lines of [s] (splits along '\n').
@since NEXT_RELEASE *)
@since 3.2 *)
val concat_gen : sep:string -> string gen -> string
(** [concat_gen ~sep gen] concatenates all strings of [gen], separated with [sep].
@ -201,11 +201,11 @@ val concat_gen : sep:string -> string gen -> string
val concat_seq : sep:string -> string Seq.t -> string
(** [concat_seq ~sep seq] concatenates all strings of [seq], separated with [sep].
@since NEXT_RELEASE *)
@since 3.2 *)
val concat_iter : sep:string -> string iter -> string
(** [concat_iter ~sep iter] concatenates all strings of [iter], separated with [sep].
@since NEXT_RELEASE *)
@since 3.2 *)
val unlines : string list -> string
(** [unlines ls] concatenates all strings of [ls], separated with '\n'.
@ -217,11 +217,11 @@ val unlines_gen : string gen -> string
val unlines_iter : string iter -> string
(** [unlines_iter iter] concatenates all strings of [iter], separated with '\n'.
@since NEXT_RELEASE *)
@since 3.2 *)
val unlines_seq : string Seq.t -> string
(** [unlines_seq seq] concatenates all strings of [seq], separated with '\n'.
@since NEXT_RELEASE *)
@since 3.2 *)
val set : string -> int -> char -> string
(** [set s i c] creates a new string which is a copy of [s], except

View file

@ -194,15 +194,15 @@ val lines_gen : string -> string gen
val lines_iter : string -> string iter
(** [lines_iter s] returns the [iter] of the lines of [s] (splits along '\n').
@since NEXT_RELEASE *)
@since 3.2 *)
val lines_seq : string -> string Seq.t
(** [lines_seq s] returns the [Seq.t] of the lines of [s] (splits along '\n').
@since NEXT_RELEASE *)
@since 3.2 *)
val concat_iter : sep:string -> string iter -> string
(** [concat_iter ~sep iter] concatenates all strings of [iter], separated with [sep].
@since NEXT_RELEASE *)
@since 3.2 *)
val concat_gen : sep:(string [@keep_label]) -> string gen -> string
(** [concat_gen ~sep gen] concatenates all strings of [gen], separated with [sep].
@ -210,7 +210,7 @@ val concat_gen : sep:(string [@keep_label]) -> string gen -> string
val concat_seq : sep:string -> string Seq.t -> string
(** [concat_seq ~sep seq] concatenates all strings of [seq], separated with [sep].
@since NEXT_RELEASE *)
@since 3.2 *)
val unlines : string list -> string
(** [unlines ls] concatenates all strings of [ls], separated with '\n'.
@ -222,11 +222,11 @@ val unlines_gen : string gen -> string
val unlines_iter : string iter -> string
(** [unlines_iter iter] concatenates all strings of [iter], separated with '\n'.
@since NEXT_RELEASE *)
@since 3.2 *)
val unlines_seq : string Seq.t -> string
(** [unlines_seq seq] concatenates all strings of [seq], separated with '\n'.
@since NEXT_RELEASE *)
@since 3.2 *)
val set : string -> int -> char -> string
(** [set s i c] creates a new string which is a copy of [s], except

View file

@ -95,7 +95,7 @@ val uchar_to_bytes : uchar -> char iter
This can be used, for example, in combination with {!Buffer.add_char}
on a pre-allocated buffer to add the bytes one by one (despite its name,
{!Buffer.add_char} takes individual bytes, not unicode codepoints).
@since NEXT_RELEASE *)
@since 3.2 *)
val of_gen : uchar gen -> t