mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-05 19:00:31 -05:00
move to ocamlformat 0.27, format code
This commit is contained in:
parent
954ea61d22
commit
7c8adbd9fc
12 changed files with 27 additions and 26 deletions
|
|
@ -1,4 +1,4 @@
|
|||
version = 0.26.2
|
||||
version = 0.27.0
|
||||
profile=conventional
|
||||
margin=80
|
||||
if-then-else=k-r
|
||||
|
|
@ -12,3 +12,4 @@ field-space=tight-decl
|
|||
leading-nested-match-parens=true
|
||||
module-item-spacing=compact
|
||||
quiet=true
|
||||
parse-docstrings=false
|
||||
|
|
|
|||
|
|
@ -128,7 +128,8 @@ module PersistentHashtbl (H : Hashtbl.HashedType) = struct
|
|||
t := Add (k, v', t');
|
||||
Table.remove tbl k;
|
||||
t'
|
||||
with Not_found -> (* not member, nothing to do *)
|
||||
with Not_found ->
|
||||
(* not member, nothing to do *)
|
||||
t
|
||||
|
||||
(*$R
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ module L = struct
|
|||
else
|
||||
Sek.Persistent.of_list 0 [ x; x + 1; x + 2; x + 3 ]
|
||||
|
||||
|
||||
let f_pvec x =
|
||||
if x mod 10 = 0 then
|
||||
Pvec.empty
|
||||
|
|
@ -149,7 +148,7 @@ module L = struct
|
|||
"flatten o map", flatten_map_ l, ();
|
||||
"ral_flatmap", flatmap_ral_ ral, ();
|
||||
"sek_flatmap", flatmap_sek sek, ();
|
||||
"pvec.flatmap", flat_map_pvec pvec, ()
|
||||
"pvec.flatmap", flat_map_pvec pvec, ();
|
||||
]
|
||||
|
||||
(* APPEND *)
|
||||
|
|
@ -823,8 +822,8 @@ module Tbl = struct
|
|||
end in
|
||||
(module T)
|
||||
|
||||
let persistent_hashtbl_ref :
|
||||
type a. a key_type -> (module MUT with type key = a) =
|
||||
let persistent_hashtbl_ref : type a.
|
||||
a key_type -> (module MUT with type key = a) =
|
||||
fun key ->
|
||||
let (module Key), name = arg_make key in
|
||||
let module T = Ref_impl.PersistentHashtbl (Key) in
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@ module Bitfield = struct
|
|||
if self.emit_failure_if_too_wide then
|
||||
fpf out
|
||||
"(* check that int size is big enough *)@,\
|
||||
@[let () = assert (Sys.int_size >= %d);;@]" (total_width self);
|
||||
@[let () = assert (Sys.int_size >= %d);;@]"
|
||||
(total_width self);
|
||||
fpf out "@]"
|
||||
|
||||
let gen_mli self : code =
|
||||
|
|
|
|||
|
|
@ -65,8 +65,10 @@ let next_ (type a) (st : Dec.t) ~(yield : uchar -> a) ~(stop : unit -> a) () : a
|
|||
(* except for first, each char gives 6 bits *)
|
||||
let next = (acc lsl 6) lor (c land 0b111111) in
|
||||
if j = n_bytes then
|
||||
if (* done reading the codepoint *)
|
||||
Uchar.is_valid next then (
|
||||
if
|
||||
(* done reading the codepoint *)
|
||||
Uchar.is_valid next
|
||||
then (
|
||||
st.i <- st.i + j + 1;
|
||||
(* +1 for first char *)
|
||||
yield (Uchar.unsafe_of_int next)
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ let _empty = Shallow Zero
|
|||
let _single x = Shallow (One x)
|
||||
let _double x y = Shallow (Two (x, y))
|
||||
|
||||
let _deep :
|
||||
type l0 l1.
|
||||
let _deep : type l0 l1.
|
||||
int ->
|
||||
('a, l0 succ) digit ->
|
||||
('a * 'a) t lazy_t ->
|
||||
|
|
|
|||
|
|
@ -221,8 +221,7 @@ module Traverse = struct
|
|||
]
|
||||
|
||||
type ('v, 'e) t =
|
||||
[ `Enter of
|
||||
'v * int * ('v, 'e) path
|
||||
[ `Enter of 'v * int * ('v, 'e) path
|
||||
(* unique index in traversal, path from start *)
|
||||
| `Exit of 'v
|
||||
| `Edge of 'v * 'e * 'v * edge_kind
|
||||
|
|
|
|||
|
|
@ -150,8 +150,7 @@ module Traverse : sig
|
|||
]
|
||||
|
||||
type ('v, 'e) t =
|
||||
[ `Enter of
|
||||
'v * int * ('v, 'e) path
|
||||
[ `Enter of 'v * int * ('v, 'e) path
|
||||
(* unique index in traversal, path from start *)
|
||||
| `Exit of 'v
|
||||
| `Edge of 'v * 'e * 'v * edge_kind
|
||||
|
|
|
|||
|
|
@ -202,8 +202,10 @@ module A_SPARSE = struct
|
|||
let open Stdlib in
|
||||
Array.blit a.arr real_idx arr (real_idx + 1) (n - real_idx));
|
||||
{ a with bits; arr }
|
||||
) else if (* replace element at [real_idx] *)
|
||||
mut then (
|
||||
) else if
|
||||
(* replace element at [real_idx] *)
|
||||
mut
|
||||
then (
|
||||
a.arr.(real_idx) <- x;
|
||||
a
|
||||
) else (
|
||||
|
|
|
|||
|
|
@ -352,8 +352,7 @@ let append a b =
|
|||
else
|
||||
fold_left push a b
|
||||
|
||||
let flat_map f v : _ t =
|
||||
fold_left (fun acc x -> append acc (f x)) empty v
|
||||
let flat_map f v : _ t = fold_left (fun acc x -> append acc (f x)) empty v
|
||||
|
||||
let rec equal_tree eq t1 t2 =
|
||||
match t1, t2 with
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ val append : 'a t -> 'a t -> 'a t
|
|||
(** [append a b] adds all elements of [b] at the end of [a]. This is
|
||||
at least linear in the length of [b]. *)
|
||||
|
||||
|
||||
val map : ('a -> 'b) -> 'a t -> 'b t
|
||||
|
||||
val flat_map : ('a -> 'b t) -> 'a t -> 'b t
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue