mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-05 19:00:31 -05:00
fixes and format
This commit is contained in:
parent
8d8f1d4145
commit
6dcaddb7c6
4 changed files with 11 additions and 7 deletions
|
|
@ -529,6 +529,10 @@ val all_ok : ('a, 'err) result t -> ('a t, 'err) result
|
|||
@since 1.3, but only
|
||||
@since 2.2 with labels *)
|
||||
|
||||
val split_result : ('ok, 'error) result list -> 'ok list * 'error list
|
||||
(** Split a list of results into [Ok]s and [Error]s.
|
||||
@since NEXT_RELEASE *)
|
||||
|
||||
val sorted_mem : cmp:(('a -> 'a -> int)[@keep_label]) -> 'a -> 'a list -> bool
|
||||
(** [sorted_mem ~cmp x l] and [mem x l] give the same result for any sorted list [l],
|
||||
but potentially more efficiently.
|
||||
|
|
|
|||
|
|
@ -247,7 +247,8 @@ module Make (O : Set.OrderedType) = struct
|
|||
let pp ?(pp_start = fun _ () -> ()) ?(pp_stop = fun _ () -> ())
|
||||
?(pp_sep = fun fmt () -> Format.fprintf fmt ",@ ") pp_x fmt m =
|
||||
let rec pp_mult ?(first = true) x n =
|
||||
if n = 0 then ()
|
||||
if n = 0 then
|
||||
()
|
||||
else (
|
||||
if not first then pp_sep fmt ();
|
||||
pp_x fmt x;
|
||||
|
|
@ -256,8 +257,7 @@ module Make (O : Set.OrderedType) = struct
|
|||
in
|
||||
pp_start fmt ();
|
||||
let first = ref true in
|
||||
iter m
|
||||
(fun x n ->
|
||||
iter m (fun x n ->
|
||||
if !first then
|
||||
first := false
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue