Skip to content

Commit

Permalink
prepare for 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Feb 1, 2021
1 parent f313361 commit 0097fd3
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 30 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;;
Expand All @@ -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 ;;
Expand Down
2 changes: 1 addition & 1 deletion containers-data.opam
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion containers-thread.opam
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion containers.opam
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCEither.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/core/CCFormat.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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}).
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions src/core/CCList.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down Expand Up @@ -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].
Expand Down
6 changes: 3 additions & 3 deletions src/core/CCListLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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].
Expand Down Expand Up @@ -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].
Expand Down
12 changes: 6 additions & 6 deletions src/core/CCString.mli
Original file line number Diff line number Diff line change
Expand Up @@ -189,23 +189,23 @@ 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].
@since 0.10 *)

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'.
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/core/CCStringLabels.mli
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,23 @@ 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].
@since 0.10 *)

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'.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/CCUtf8_string.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0097fd3

Please sign in to comment.