From b3c796176d63ed15ef88b473c94bd61443335e68 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 7 Feb 2018 08:22:41 -0600 Subject: [PATCH] reindent --- src/core/CCFormat.ml | 2 +- src/core/CCList.ml | 2 +- src/core/CCList.mli | 2 +- src/core/CCString.ml | 14 +++++++------- src/core/CCString.mli | 8 ++++---- src/data/CCRAL.ml | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/core/CCFormat.ml b/src/core/CCFormat.ml index b03250dc..c99aae73 100644 --- a/src/core/CCFormat.ml +++ b/src/core/CCFormat.ml @@ -390,7 +390,7 @@ let ksprintf ~f fmt = (Some "hello world") \ (ksprintf "hello %a" CCFormat.string "world" ~f:(fun s -> Some s)) *) - + module Dump = struct type 'a t = 'a printer let unit = unit diff --git a/src/core/CCList.ml b/src/core/CCList.ml index 2f165599..82291ba3 100644 --- a/src/core/CCList.ml +++ b/src/core/CCList.ml @@ -1265,7 +1265,7 @@ let replicate i x = Q.(pair small_int (small_list int)) (fun (n,l) -> \ if n>0 then repeat n l = flat_map (fun _ -> l) (1--n) \ else Q.assume_fail()) - *) +*) let repeat i l = let rec aux acc i = diff --git a/src/core/CCList.mli b/src/core/CCList.mli index 92d19d98..b80bf76a 100644 --- a/src/core/CCList.mli +++ b/src/core/CCList.mli @@ -339,7 +339,7 @@ val sorted_insert : cmp:('a -> 'a -> int) -> ?uniq:bool -> 'a -> 'a list -> 'a l @param uniq if true and [x] is already in sorted position in [l], then [x] is not duplicated. Default [false] ([x] will be inserted in any case). @since 0.17 *) - + val uniq_succ : eq:('a -> 'a -> bool) -> 'a list -> 'a list (** [uniq_succ l] removes duplicate elements that occur one next to the other. Examples: diff --git a/src/core/CCString.ml b/src/core/CCString.ml index 829954e4..aadd9d9c 100644 --- a/src/core/CCString.ml +++ b/src/core/CCString.ml @@ -287,7 +287,7 @@ let find ?(start=0) ~sub = let i = find ~sub:s2 s1 in \ i < 0 || String.sub s1 i (length s2) = s2) *) - + let find_all ?(start=0) ~sub = let pattern = Find.compile sub in fun s -> @@ -313,14 +313,14 @@ let find_all_l ?start ~sub s = [76] (find_all_l ~sub:"aaaaaa" \ "aabbaabbaaaaabbbbabababababbbbabbbabbaaababbbaaabaabbaabbaaaabbababaaaabbaabaaaaaabbbaaaabababaabaaabbaabaaaabbababbaabbaaabaabbabababbbaabababaaabaaababbbaaaabbbaabaaababbabaababbaabbaaaaabababbabaababbbaaabbabbabababaaaabaaababaaaaabbabbaabbabbbbbbbbbbbbbbaabbabbbbbabbaaabbabbbbabaaaaabbababbbaaaa") *) - + let mem ?start ~sub s = find ?start ~sub s >= 0 (*$T mem ~sub:"bc" "abcd" not (mem ~sub:"a b" "abcd") *) - + let rfind ~sub = let pattern = Find.rcompile sub in fun s -> Find.rfind ~start:(String.length s-1) ~pattern s @@ -508,7 +508,7 @@ module Split = struct Split.right ~by:"_" "abcde" = None Split.right ~by:"a_" "abcde" = None *) - + end let split_on_char c s: _ list = @@ -848,10 +848,10 @@ let of_list l = of_list ['a'; 'b'; 'c'] = "abc" of_list [] = "" *) - + let of_array a = init (Array.length a) (fun i -> a.(i)) - + let to_array s = Array.init (String.length s) (fun i -> s.[i]) @@ -1136,7 +1136,7 @@ module Sub = struct |> Sequence.for_all (fun (i,j,sub) -> Sub.get sub j = s.[i+j])) *) - + let to_gen (s,i,len) = _to_gen s i len let to_seq (s,i,len) k = for i=i to i+len-1 do k s.[i] done diff --git a/src/core/CCString.mli b/src/core/CCString.mli index 611b15ea..60de9493 100644 --- a/src/core/CCString.mli +++ b/src/core/CCString.mli @@ -107,13 +107,13 @@ val of_list : char list -> string val of_array : char array -> string (** Convert an array of characters to a string. *) - + val to_array : string -> char array (** Return the array of characters contained in the string. *) val find : ?start:int -> sub:string -> string -> int (** Find [sub] in string, returns its first index or [-1]. *) - + val find_all : ?start:int -> sub:string -> string -> int gen (** [find_all ~sub s] finds all occurrences of [sub] in [s], even overlapping instances. @@ -125,11 +125,11 @@ val find_all_l : ?start:int -> sub:string -> string -> int list them in a list. @param start starting position in [s]. @since 0.17 *) - + val mem : ?start:int -> sub:string -> string -> bool (** [mem ~sub s] is true iff [sub] is a substring of [s]. @since 0.12 *) - + val rfind : sub:string -> string -> int (** Find [sub] in string from the right, returns its first index or [-1]. Should only be used with very small [sub]. diff --git a/src/data/CCRAL.ml b/src/data/CCRAL.ml index 6a214769..2799f081 100644 --- a/src/data/CCRAL.ml +++ b/src/data/CCRAL.ml @@ -262,7 +262,7 @@ let flat_map f l = let f x = Q.Fn.apply f x in \ let f' x = f x |> of_list in \ of_list l |> flat_map f' |> to_list = CCList.(flat_map f l)) - *) +*) let flatten l = fold_rev ~f:(fun acc l -> append l acc) ~x:empty l @@ -274,7 +274,7 @@ let flatten l = fold_rev ~f:(fun acc l -> append l acc) ~x:empty l (*$Q Q.(small_list (small_list int)) (fun l -> \ of_list l |> map ~f:of_list |> flatten |> to_list = CCList.flatten l) - *) +*) let app funs l = fold_rev ~x:empty funs @@ -452,7 +452,7 @@ let repeat n l = (*$Q Q.(pair small_int (list int)) (fun (n,l) -> \ of_list l |> repeat n |> to_list = CCList.(repeat n l)) - *) +*) let range i j = let rec aux i j acc =