Skip to content

Commit 03fd42e

Browse files
committed
reindentation
1 parent 416d19a commit 03fd42e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1674
-1674
lines changed

src/core/CCArray.ml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ let fold_while f acc a =
6262
if i < Array.length a then
6363
let acc, cont = f acc a.(i) in
6464
match cont with
65-
| `Stop -> acc
66-
| `Continue -> fold_while_i f acc (i+1)
65+
| `Stop -> acc
66+
| `Continue -> fold_while_i f acc (i+1)
6767
else acc
6868
in fold_while_i f acc 0
6969

@@ -106,7 +106,7 @@ let sorted cmp a =
106106
(*$= & ~cmp:(=) ~printer:Q.Print.(array int)
107107
[||] (sorted Pervasives.compare [||])
108108
[|0;1;2;3;4|] (sorted Pervasives.compare [|3;2;1;4;0|])
109-
*)
109+
*)
110110

111111
(*$Q
112112
Q.(array int) (fun a -> \
@@ -160,7 +160,7 @@ let rev a =
160160
rev [| 1; 2; 3 |] = [| 3; 2; 1 |]
161161
rev [| 1; 2; |] = [| 2; 1 |]
162162
rev [| |] = [| |]
163-
*)
163+
*)
164164

165165
let rec find_aux f a i =
166166
if i = Array.length a then None
@@ -229,27 +229,27 @@ let flat_map f a =
229229
let rec _lookup_rec ~cmp k a i j =
230230
if i>j then raise Not_found
231231
else if i=j
232-
then if cmp k a.(i) = 0
233-
then i
234-
else raise Not_found
232+
then if cmp k a.(i) = 0
233+
then i
234+
else raise Not_found
235235
else
236236
let middle = (j+i)/2 in
237237
match cmp k a.(middle) with
238-
| 0 -> middle
239-
| n when n<0 -> _lookup_rec ~cmp k a i (middle-1)
240-
| _ -> _lookup_rec ~cmp k a (middle+1) j
238+
| 0 -> middle
239+
| n when n<0 -> _lookup_rec ~cmp k a i (middle-1)
240+
| _ -> _lookup_rec ~cmp k a (middle+1) j
241241

242242
let _lookup_exn ~cmp k a i j =
243243
if i>j then raise Not_found;
244244
match cmp k a.(i) with
245-
| 0 -> i
246-
| n when n<0 -> raise Not_found (* too low *)
247-
| _ when i=j -> raise Not_found (* too high *)
248-
| _ ->
245+
| 0 -> i
246+
| n when n<0 -> raise Not_found (* too low *)
247+
| _ when i=j -> raise Not_found (* too high *)
248+
| _ ->
249249
match cmp k a.(j) with
250-
| 0 -> j
251-
| n when n<0 -> _lookup_rec ~cmp k a (i+1) (j-1)
252-
| _ -> raise Not_found (* too high *)
250+
| 0 -> j
251+
| n when n<0 -> _lookup_rec ~cmp k a (i+1) (j-1)
252+
| _ -> raise Not_found (* too high *)
253253

254254
let lookup_exn ?(cmp=Pervasives.compare) k a =
255255
_lookup_exn ~cmp k a 0 (Array.length a-1)
@@ -371,8 +371,8 @@ let (--) i j =
371371
let (--^) i j =
372372
if i=j then [| |]
373373
else if i>j
374-
then Array.init (i-j) (fun k -> i-k)
375-
else Array.init (j-i) (fun k -> i+k)
374+
then Array.init (i-j) (fun k -> i-k)
375+
else Array.init (j-i) (fun k -> i+k)
376376

377377
(*$Q
378378
Q.(pair small_int small_int) (fun (a,b) -> \
@@ -540,7 +540,7 @@ module SortGeneric(A : MONO_ARRAY) = struct
540540
in
541541
let rand = Rand.make seed_ in
542542
(* sort slice.
543-
There is a chance that the two pivots are equal, but it's unlikely. *)
543+
There is a chance that the two pivots are equal, but it's unlikely. *)
544544
let rec sort_slice_ ~st a i j =
545545
if j-i>10 then (
546546
st.l <- i;
@@ -565,7 +565,7 @@ module SortGeneric(A : MONO_ARRAY) = struct
565565
swap_ a st.k st.g;
566566
st.g <- st.g - 1;
567567
(* the element swapped from the right might be in the first situation.
568-
that is, < p (we know it's <= q already) *)
568+
that is, < p (we know it's <= q already) *)
569569
if cmp (A.get a st.k) p < 0 then (
570570
if st.k <> st.l then swap_ a st.k st.l;
571571
st.l <- st.l + 1
@@ -588,9 +588,9 @@ end
588588

589589

590590
let sort_generic (type arr)(type elt)
591-
(module A : MONO_ARRAY with type t = arr and type elt = elt)
592-
?(cmp=Pervasives.compare) a
593-
=
591+
(module A : MONO_ARRAY with type t = arr and type elt = elt)
592+
?(cmp=Pervasives.compare) a
593+
=
594594
let module S = SortGeneric(A) in
595595
S.sort ~cmp a
596596

src/core/CCArray_slice.ml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ let rec _compare cmp a1 i1 j1 a2 i2 j2 =
7575
if i1 = j1
7676
then if i2=j2 then 0 else -1
7777
else if i2=j2
78-
then 1
79-
else
80-
let c = cmp a1.(i1) a2.(i2) in
81-
if c = 0
82-
then _compare cmp a1 (i1+1) j1 a2 (i2+1) j2
83-
else c
78+
then 1
79+
else
80+
let c = cmp a1.(i1) a2.(i2) in
81+
if c = 0
82+
then _compare cmp a1 (i1+1) j1 a2 (i2+1) j2
83+
else c
8484

8585
let equal eq a b =
8686
length a = length b && _equal eq a.arr a.i a.j b.arr b.i b.j
@@ -105,8 +105,8 @@ let fold_while f acc a =
105105
if i < Array.length a.arr && i < a.j then
106106
let acc, cont = f acc a.arr.(i) in
107107
match cont with
108-
| `Stop -> acc
109-
| `Continue -> fold_while_i f acc (i+1)
108+
| `Stop -> acc
109+
| `Continue -> fold_while_i f acc (i+1)
110110
else acc
111111
in fold_while_i f acc a.i
112112

@@ -157,44 +157,44 @@ let rec _find f a i j =
157157
let rec _lookup_rec ~cmp k a i j =
158158
if i>j then raise Not_found
159159
else if i=j
160-
then if cmp k a.(i) = 0
161-
then i
162-
else raise Not_found
160+
then if cmp k a.(i) = 0
161+
then i
162+
else raise Not_found
163163
else
164164
let middle = (j+i)/2 in
165165
match cmp k a.(middle) with
166-
| 0 -> middle
167-
| n when n<0 -> _lookup_rec ~cmp k a i (middle-1)
168-
| _ -> _lookup_rec ~cmp k a (middle+1) j
166+
| 0 -> middle
167+
| n when n<0 -> _lookup_rec ~cmp k a i (middle-1)
168+
| _ -> _lookup_rec ~cmp k a (middle+1) j
169169

170170
let _lookup_exn ~cmp k a i j =
171171
if i>j then raise Not_found;
172172
match cmp k a.(i) with
173-
| 0 -> i
174-
| n when n<0 -> raise Not_found (* too low *)
175-
| _ when i=j -> raise Not_found (* too high *)
176-
| _ ->
173+
| 0 -> i
174+
| n when n<0 -> raise Not_found (* too low *)
175+
| _ when i=j -> raise Not_found (* too high *)
176+
| _ ->
177177
match cmp k a.(j) with
178-
| 0 -> j
179-
| n when n<0 -> _lookup_rec ~cmp k a (i+1) (j-1)
180-
| _ -> raise Not_found (* too high *)
178+
| 0 -> j
179+
| n when n<0 -> _lookup_rec ~cmp k a (i+1) (j-1)
180+
| _ -> raise Not_found (* too high *)
181181

182182
let bsearch_ ~cmp x arr i j =
183183
let rec aux i j =
184184
if i > j
185-
then `Just_after j
186-
else
187-
let middle = i + (j - i) / 2 in (* avoid overflow *)
188-
match cmp x arr.(middle) with
185+
then `Just_after j
186+
else
187+
let middle = i + (j - i) / 2 in (* avoid overflow *)
188+
match cmp x arr.(middle) with
189189
| 0 -> `At middle
190190
| n when n<0 -> aux i (middle - 1)
191191
| _ -> aux (middle + 1) j
192192
in
193193
if i>=j then `Empty
194194
else match cmp arr.(i) x, cmp arr.(j) x with
195-
| n, _ when n>0 -> `All_bigger
196-
| _, n when n<0 -> `All_lower
197-
| _ -> aux i j
195+
| n, _ when n>0 -> `All_bigger
196+
| _, n when n<0 -> `All_lower
197+
| _ -> aux i j
198198

199199
let rec _for_all p a i j =
200200
i = j || (p a.(i) && _for_all p a (i+1) j)
@@ -267,7 +267,7 @@ let rec _to_klist a i j () =
267267
let reverse_in_place a = _reverse_in_place a.arr a.i ~len:(length a)
268268

269269
(*$T
270-
let a = 1--6 in let s = make a 2 ~len:3 in \
270+
let a = 1--6 in let s = make a 2 ~len:3 in \
271271
reverse_in_place s; a = [| 1; 2; 5; 4; 3; 6 |]
272272
*)
273273

@@ -343,7 +343,7 @@ let find_idx p a =
343343

344344
(*$=
345345
(Some (1,"c")) (find_idx ((=) "c") (make [| "a"; "b"; "c" |] 1 2))
346-
*)
346+
*)
347347

348348
let lookup_exn ?(cmp=Pervasives.compare) k a =
349349
_lookup_exn ~cmp k a.arr a.i (a.j-1) - a.i
@@ -354,7 +354,7 @@ let lookup ?(cmp=Pervasives.compare) k a =
354354

355355
(*$=
356356
(Some 1) (lookup "c" (make [| "a"; "b"; "c" |] 1 2))
357-
*)
357+
*)
358358

359359
let bsearch ?(cmp=Pervasives.compare) k a =
360360
match bsearch_ ~cmp k a.arr a.i (a.j - 1) with
@@ -373,7 +373,7 @@ let exists2 p a b =
373373
_exists2 p a.arr b.arr a.i b.i ~len:(min (length a) (length b))
374374

375375
(*$T
376-
exists2 (=) (make [| 1;2;3;4 |] 1 ~len:2) (make [| 0;1;3;4 |] 1 ~len:3)
376+
exists2 (=) (make [| 1;2;3;4 |] 1 ~len:2) (make [| 0;1;3;4 |] 1 ~len:3)
377377
*)
378378

379379
let _iter2 f a b i j ~len =

src/core/CCChar.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
(** {1 Utils around char}
44
5-
@since 0.14 *)
5+
@since 0.14 *)
66

77
type t = char
88

src/core/CCChar.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
(** {1 Utils around char}
44
5-
@since 0.14 *)
5+
@since 0.14 *)
66

77
type t = char
88

src/core/CCFloat.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
(* This file is free software, part of containers. See file "license" for more details. *)
33

44
(** {1 Basic Float functions}
5-
@since 0.6.1 *)
5+
@since 0.6.1 *)
66

77
type t = float
88
type fpclass = Pervasives.fpclass =

src/core/CCFormat.ml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ let string_quoted fmt s = Format.fprintf fmt "\"%s\"" s
4040

4141
let list ?(sep=return ",@ ") pp fmt l =
4242
let rec pp_list l = match l with
43-
| x::((_::_) as l) ->
44-
pp fmt x;
45-
sep fmt ();
46-
pp_list l
47-
| x::[] -> pp fmt x
48-
| [] -> ()
43+
| x::((_::_) as l) ->
44+
pp fmt x;
45+
sep fmt ();
46+
pp_list l
47+
| x::[] -> pp fmt x
48+
| [] -> ()
4949
in
5050
pp_list l
5151

@@ -152,7 +152,7 @@ let tee a b =
152152
Format.fprintf fmt "coucou@.";
153153
assert_equal ~printer:CCFun.id "coucou\n" (Buffer.contents buf1);
154154
assert_equal ~printer:CCFun.id "coucou\n" (Buffer.contents buf2);
155-
*)
155+
*)
156156

157157
let to_file filename format =
158158
let oc = open_out filename in
@@ -262,9 +262,9 @@ let set_color_tag_handling ppf =
262262
let functions = pp_get_formatter_tag_functions ppf () in
263263
let st = Stack.create () in (* stack of styles *)
264264
let functions' = {functions with
265-
mark_open_tag=(mark_open_tag st ~or_else:functions.mark_open_tag);
266-
mark_close_tag=(mark_close_tag st ~or_else:functions.mark_close_tag);
267-
} in
265+
mark_open_tag=(mark_open_tag st ~or_else:functions.mark_open_tag);
266+
mark_close_tag=(mark_close_tag st ~or_else:functions.mark_close_tag);
267+
} in
268268
pp_set_mark_tags ppf true; (* enable tags *)
269269
pp_set_formatter_tag_functions ppf functions'
270270

src/core/CCFormat.mli

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
(** {1 Helpers for Format}
55
6-
@since 0.8 *)
6+
@since 0.8 *)
77

88
type 'a sequence = ('a -> unit) -> unit
99

@@ -48,7 +48,7 @@ val opt : 'a printer -> 'a option printer
4848
val pair : ?sep:unit printer -> 'a printer -> 'b printer -> ('a * 'b) printer
4949
val triple : ?sep:unit printer -> 'a printer -> 'b printer -> 'c printer -> ('a * 'b * 'c) printer
5050
val quad : ?sep:unit printer -> 'a printer -> 'b printer ->
51-
'c printer -> 'd printer -> ('a * 'b * 'c * 'd) printer
51+
'c printer -> 'd printer -> ('a * 'b * 'c * 'd) printer
5252

5353
val within : string -> string -> 'a printer -> 'a printer
5454
(** [within a b p] wraps [p] inside the strings [a] and [b]. Convenient,
@@ -105,13 +105,13 @@ val some : 'a printer -> 'a option printer
105105

106106
(** {2 ANSI codes}
107107
108-
Use ANSI escape codes https://en.wikipedia.org/wiki/ANSI_escape_code
109-
to put some colors on the terminal.
108+
Use ANSI escape codes https://en.wikipedia.org/wiki/ANSI_escape_code
109+
to put some colors on the terminal.
110110
111-
This uses {b tags} in format strings to specify the style. Current styles
112-
are the following:
111+
This uses {b tags} in format strings to specify the style. Current styles
112+
are the following:
113113
114-
{ul
114+
{ul
115115
{- "reset" resets style}
116116
{- "black" }
117117
{- "red" }
@@ -130,19 +130,19 @@ val some : 'a printer -> 'a option printer
130130
{- "Magenta" bold magenta }
131131
{- "Cyan" bold cyan }
132132
{- "White" bold white }
133-
}
133+
}
134134
135-
Example:
135+
Example:
136136
137-
{[
138-
set_color_default true;;
137+
{[
138+
set_color_default true;;
139139
140-
Format.printf
141-
"what is your @{<White>favorite color@}? @{<blue>blue@}! No, @{<red>red@}! Ahhhhhhh@.";;
142-
]}
140+
Format.printf
141+
"what is your @{<White>favorite color@}? @{<blue>blue@}! No, @{<red>red@}! Ahhhhhhh@.";;
142+
]}
143143
144-
{b status: experimental}
145-
@since 0.15 *)
144+
{b status: experimental}
145+
@since 0.15 *)
146146

147147
val set_color_tag_handling : t -> unit
148148
(** adds functions to support color tags to the given formatter.

0 commit comments

Comments
 (0)