Skip to content

Commit 56462a8

Browse files
committed
Merge branch 'master' into prepare-1.0
2 parents 03fd42e + 0046bea commit 56462a8

File tree

12 files changed

+70
-13
lines changed

12 files changed

+70
-13
lines changed

AUTHORS.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
- Geoff Gole (@gsg)
1818
- Roma Sokolov (@little-arhat)
1919
- Malcolm Matalka (`orbitz`)
20+
- David Sheets (@dsheets)

CHANGELOG.adoc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
= Changelog
22

3+
== 0.22
4+
5+
- threads/CCLock: add `try_with_lock` to wrap `Mutex.try_lock`
6+
- Add `CCMultiSet.remove_all`
7+
- document errors in `CCIO` (close #86)
8+
- use the new qtest/qcheck
9+
10+
== 0.21
11+
12+
- (breaking) make default `start`/`stop` arguments empty in printers (#82)
13+
14+
- add `CCFormat.{with_color_sf,fprintf_dyn_color,sprintf_dyn_color}`
15+
- add `CCFormat.Dump` for easy debugging (see #82)
16+
- add `CCArray.Sub.to_list`
17+
- add `CCArray.{sorted,sort_indices,sort_ranking}` (closes #81)
18+
19+
- handle '\r` in CCSexpM (fixes #83)
20+
- add alias `Containers.IO`
21+
- bugfixes in `CCArray.Sub`
22+
- bugfix + tests for `CCArray.Sub.sub`
23+
- disable parallel build to support cygwin
24+
325
== 0.20
426

527
- bugfix in `CCArray.equal`

README.adoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ Iterators:
180180
- `CCKList`, a persistent iterator structure (akin to a lazy list, without memoization)
181181
- `CCKTree`, an abstract lazy tree structure
182182

183-
184183
=== Thread
185184

186185
In the library `containers.thread`, for preemptive system threads:

_oasis

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
OASISFormat: 0.4
22
Name: containers
3-
Version: 0.20
3+
Version: 0.22
44
Homepage: https://github.com/c-cube/ocaml-containers
55
Authors: Simon Cruanes
66
License: BSD-2-clause

opam

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ depopts: [
3838
]
3939
conflicts: [
4040
"sequence" { < "0.5" }
41-
"qtest" { < "2.2" }
42-
"qcheck"
4341
]
4442
tags: [ "stdlib" "containers" "iterators" "list" "heap" "queue" ]
4543
homepage: "https://github.com/c-cube/ocaml-containers/"

src/core/CCFormat.mli

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ val with_color_sf : string -> ('a, t, unit, string) format4 -> 'a
173173
CCFormat.with_color_sf "red" "%a" CCFormat.Dump.(list int) [1;2;3] |> print_endline;;
174174
]}
175175
{b status: experimental}
176-
@since NEXT_RELEASE *)
176+
@since 0.21 *)
177177

178178
(** {2 IO} *)
179179

@@ -207,15 +207,15 @@ val sprintf_dyn_color : colors:bool -> ('a, t, unit, string) format4 -> 'a
207207
CCFormat.sprintf_dyn_color ~colors:false "@{<Red>%a@}"
208208
CCFormat.Dump.(list int) [1;2;3] |> print_endline;;
209209
]}
210-
@since NEXT_RELEASE *)
210+
@since 0.21 *)
211211

212212
val fprintf : t -> ('a, t, unit ) format -> 'a
213213
(** Alias to {!Format.fprintf}
214214
@since 0.14 *)
215215

216216
val fprintf_dyn_color : colors:bool -> t -> ('a, t, unit ) format -> 'a
217217
(** Similar to {!fprintf} but enable/disable colors depending on [colors]
218-
@since NEXT_RELEASE *)
218+
@since 0.21 *)
219219

220220
val ksprintf :
221221
f:(string -> 'b) ->
@@ -246,7 +246,7 @@ val to_file : string -> ('a, t, unit, unit) format4 -> 'a
246246
[| [1, true; 2, false]; []; [42, false] |];;
247247
]}
248248
249-
@since NEXT_RELEASE *)
249+
@since 0.21 *)
250250

251251
module Dump : sig
252252
type 'a t = 'a printer

src/core/CCIO.mli

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ val with_in : ?mode:int -> ?flags:open_flag list ->
4646
(** Open an input file with the given optional flag list, calls the function
4747
on the input channel. When the function raises or returns, the
4848
channel is closed.
49+
@raise Sys_error in case of error (same as {!open_in} and {!close_in})
4950
@param flags opening flags (default [[Open_text]]). [Open_rdonly] is used in any cases *)
5051

5152
val read_chunks : ?size:int -> in_channel -> string gen
@@ -77,12 +78,14 @@ val with_out : ?mode:int -> ?flags:open_flag list ->
7778
string -> (out_channel -> 'a) -> 'a
7879
(** Same as {!with_in} but for an output channel
7980
@param flags opening flags (default [[Open_creat; Open_trunc; Open_text]]).
81+
@raise Sys_error in case of error (same as {!open_out} and {!close_out})
8082
[Open_wronly] is used in any cases *)
8183

8284
val with_out_a : ?mode:int -> ?flags:open_flag list ->
8385
string -> (out_channel -> 'a) -> 'a
8486
(** Similar to {!with_out} but with the [[Open_append; Open_creat; Open_wronly]]
85-
flags activated, to append to the file *)
87+
flags activated, to append to the file.
88+
@raise Sys_error in case of error (same as {!open_out} and {!close_out}) *)
8689

8790
val write_line : out_channel -> string -> unit
8891
(** Write the given string on the channel, followed by "\n" *)
@@ -102,6 +105,7 @@ val with_in_out : ?mode:int -> ?flags:open_flag list ->
102105
string -> (in_channel -> out_channel -> 'a) -> 'a
103106
(** Combines {!with_in} and {!with_out}.
104107
@param flags opening flags (default [[Open_creat]])
108+
@raise Sys_error in case of error
105109
@since 0.12 *)
106110

107111
(** {2 Misc for Generators} *)
@@ -144,7 +148,7 @@ module File : sig
144148
(** [remove_exn path] tries to remove the file at [path] from the
145149
file system.
146150
147-
{b Raises} [Sys_error] if there is no file at [path].
151+
@raise Sys_error if there is no file at [path] or access rights are wrong.
148152
@since 0.8 *)
149153

150154
val remove : t -> unit or_error
@@ -158,11 +162,13 @@ module File : sig
158162
val read_dir : ?recurse:bool -> t -> t gen
159163
(** [read_dir d] returns a sequence of files and directory contained
160164
in the directory [d] (or an empty stream if [d] is not a directory)
165+
@raise Sys_error in case of error (e.g. permission denied)
161166
@param recurse if true (default [false]), sub-directories are also
162167
explored *)
163168

164169
val read_exn : t -> string
165170
(** Read the content of the given file, or raises some exception
171+
@raise Sys_error in case of error
166172
@since 0.16 *)
167173

168174
val read : t -> string or_error
@@ -171,6 +177,7 @@ module File : sig
171177

172178
val append_exn : t -> string -> unit
173179
(** Append the given string into the given file, possibly raising
180+
@raise Sys_error in case of error
174181
@since 0.16 *)
175182

176183
val append : t -> string -> unit or_error
@@ -179,6 +186,7 @@ module File : sig
179186

180187
val write_exn : t -> string -> unit
181188
(** Write the given string into the given file, possibly raising
189+
@raise Sys_error in case of error
182190
@since 0.16 *)
183191

184192
val write : t -> string -> unit or_error
@@ -191,7 +199,8 @@ module File : sig
191199
(** Similar to {!read_dir} (with [recurse=true]), this function walks
192200
a directory recursively and yields either files or directories.
193201
Is a file anything that doesn't satisfy {!is_directory} (including
194-
symlinks, etc.) *)
202+
symlinks, etc.)
203+
@raise Sys_error in case of error (e.g. permission denied) during iteration *)
195204

196205
val show_walk_item : walk_item -> string
197206

src/core/containers.ml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,3 @@ module String = struct
8383
include CCString
8484
end
8585
module Vector = CCVector
86-

src/data/CCMultiSet.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ module type S = sig
3333
@raise Invalid_argument if [n < 0]
3434
@since 0.6 *)
3535

36+
val remove_all : t -> elt -> t
37+
(** [remove_all set x] removes all occurrences of [x] from [set]
38+
@since 0.22 *)
39+
3640
val update : t -> elt -> (int -> int) -> t
3741
(** [update set x f] calls [f n] where [n] is the current multiplicity
3842
of [x] in [set] ([0] to indicate its absence); the result of [f n]
@@ -136,6 +140,8 @@ module Make(O : Set.OrderedType) = struct
136140

137141
let remove ms x = remove_mult ms x 1
138142

143+
let remove_all ms x = M.remove x ms
144+
139145
let update ms x f =
140146
let n = count ms x in
141147
match f n with

src/data/CCMultiSet.mli

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ module type S = sig
3333
@raise Invalid_argument if [n < 0]
3434
@since 0.6 *)
3535

36+
val remove_all : t -> elt -> t
37+
(** [remove_all set x] removes all occurrences of [x] from [set]
38+
@since 0.22 *)
39+
3640
val update : t -> elt -> (int -> int) -> t
3741
(** [update set x f] calls [f n] where [n] is the current multiplicity
3842
of [x] in [set] ([0] to indicate its absence); the result of [f n]

0 commit comments

Comments
 (0)