diff --git a/src/core/CCArray.mli b/src/core/CCArray.mli index 458896f8..1acd7772 100644 --- a/src/core/CCArray.mli +++ b/src/core/CCArray.mli @@ -29,12 +29,12 @@ val swap : 'a t -> int -> int -> unit val get : 'a t -> int -> 'a (** [get a n] returns the element number [n] of array [a]. - The first element has number 0. - The last element has number [length a - 1]. - You can also write [a.(n)] instead of [get a n]. + The first element has number 0. + The last element has number [length a - 1]. + You can also write [a.(n)] instead of [get a n]. - Raise [Invalid_argument "index out of bounds"] - if [n] is outside the range 0 to [(length a - 1)]. *) + Raise [Invalid_argument "index out of bounds"] + if [n] is outside the range 0 to [(length a - 1)]. *) val get_safe : 'a t -> int -> 'a option (** [get_safe a i] returns [Some a.(i)] if [i] is a valid index. @@ -42,18 +42,18 @@ val get_safe : 'a t -> int -> 'a option val set : 'a t -> int -> 'a -> unit (** [set a n x] modifies array [a] in place, replacing - element number [n] with [x]. - You can also write [a.(n) <- x] instead of [set a n x]. + element number [n] with [x]. + You can also write [a.(n) <- x] instead of [set a n x]. - Raise [Invalid_argument "index out of bounds"] - if [n] is outside the range 0 to [length a - 1]. *) + Raise [Invalid_argument "index out of bounds"] + if [n] is outside the range 0 to [length a - 1]. *) val length : _ t -> int (** Return the length (number of elements) of the given array. *) val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a (** [fold f x a] computes [f (... (f (f x a.(0)) a.(1)) ...) a.(n-1)], - where [n] is the length of the array [a]. *) + where [n] is the length of the array [a]. *) val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a (** Fold left on array, with index. *) @@ -75,24 +75,24 @@ val scan_left : ('acc -> 'a -> 'acc) -> 'acc -> 'a t -> 'acc t val iter : ('a -> unit) -> 'a t -> unit (** [iter f a] applies function [f] in turn to all - the elements of [a]. It is equivalent to - [f a.(0); f a.(1); ...; f a.(length a - 1); ()]. *) + the elements of [a]. It is equivalent to + [f a.(0); f a.(1); ...; f a.(length a - 1); ()]. *) val iteri : (int -> 'a -> unit) -> 'a t -> unit (** Same as {!Array.iter}, but the - function is applied with the index of the element as first argument, - and the element itself as second argument. *) + function is applied with the index of the element as first argument, + and the element itself as second argument. *) val blit : 'a t -> int -> 'a t -> int -> int -> unit (** [blit v1 o1 v2 o2 len] copies [len] elements - from array [v1], starting at element number [o1], to array [v2], - starting at element number [o2]. It works correctly even if - [v1] and [v2] are the same array, and the source and - destination chunks overlap. + from array [v1], starting at element number [o1], to array [v2], + starting at element number [o2]. It works correctly even if + [v1] and [v2] are the same array, and the source and + destination chunks overlap. - Raise [Invalid_argument "Array.blit"] if [o1] and [len] do not - designate a valid subarray of [v1], or if [o2] and [len] do not - designate a valid subarray of [v2]. *) + Raise [Invalid_argument "Array.blit"] if [o1] and [len] do not + designate a valid subarray of [v1], or if [o2] and [len] do not + designate a valid subarray of [v2]. *) val reverse_in_place : 'a t -> unit (** Reverse the array in place. *) @@ -177,8 +177,8 @@ val bsearch : cmp:('a -> 'a -> int) -> 'a -> 'a t -> val for_all : ('a -> bool) -> 'a t -> bool (** [for_all p [|a1; ...; an|]] checks if all elements of the array - satisfy the predicate [p]. That is, it returns - [(p a1) && (p a2) && ... && (p an)]. *) + satisfy the predicate [p]. That is, it returns + [(p a1) && (p a2) && ... && (p an)]. *) val for_all2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool (** Forall on pairs of arrays. @@ -231,13 +231,13 @@ val pp_i: ?sep:string -> (int -> 'a printer) -> 'a t printer val map : ('a -> 'b) -> 'a t -> 'b t (** [map f a] applies function [f] to all the elements of [a], - and builds an array with the results returned by [f]: - [[| f a.(0); f a.(1); ...; f a.(length a - 1) |]]. *) + and builds an array with the results returned by [f]: + [[| f a.(0); f a.(1); ...; f a.(length a - 1) |]]. *) val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t (** [map2 f a b] applies function [f] to all the elements of [a] and [b], - and builds an array with the results returned by [f]: - [[| f a.(0) b.(0); ...; f a.(length a - 1) b.(length b - 1)|]]. + and builds an array with the results returned by [f]: + [[| f a.(0) b.(0); ...; f a.(length a - 1) b.(length b - 1)|]]. @raise Invalid_argument if they have distinct lengths. @since 0.20 *) diff --git a/src/core/CCArrayLabels.mli b/src/core/CCArrayLabels.mli index b2b46279..4cf926d9 100644 --- a/src/core/CCArrayLabels.mli +++ b/src/core/CCArrayLabels.mli @@ -25,12 +25,12 @@ val compare : 'a ord -> 'a t ord val get : 'a t -> int -> 'a (** [get a n] returns the element number [n] of array [a]. - The first element has number 0. - The last element has number [length a - 1]. - You can also write [a.(n)] instead of [get a n]. + The first element has number 0. + The last element has number [length a - 1]. + You can also write [a.(n)] instead of [get a n]. - Raise [Invalid_argument "index out of bounds"] - if [n] is outside the range 0 to [(length a - 1)]. *) + Raise [Invalid_argument "index out of bounds"] + if [n] is outside the range 0 to [(length a - 1)]. *) val get_safe : 'a t -> int -> 'a option (** [get_safe a i] returns [Some a.(i)] if [i] is a valid index. @@ -38,18 +38,18 @@ val get_safe : 'a t -> int -> 'a option val set : 'a t -> int -> 'a -> unit (** [set a n x] modifies array [a] in place, replacing - element number [n] with [x]. - You can also write [a.(n) <- x] instead of [set a n x]. + element number [n] with [x]. + You can also write [a.(n) <- x] instead of [set a n x]. - Raise [Invalid_argument "index out of bounds"] - if [n] is outside the range 0 to [length a - 1]. *) + Raise [Invalid_argument "index out of bounds"] + if [n] is outside the range 0 to [length a - 1]. *) val length : _ t -> int (** Return the length (number of elements) of the given array. *) val fold : f:('a -> 'b -> 'a) -> init:'a -> 'b t -> 'a (** [fold f x a] computes [f (... (f (f x a.(0)) a.(1)) ...) a.(n-1)], - where [n] is the length of the array [a]. *) + where [n] is the length of the array [a]. *) val foldi : f:('a -> int -> 'b -> 'a) -> init:'a -> 'b t -> 'a (** Fold left on array, with index. *) @@ -61,24 +61,24 @@ val fold_while : f:('a -> 'b -> 'a * [`Stop | `Continue]) -> init:'a -> 'b t -> val iter : f:('a -> unit) -> 'a t -> unit (** [iter f a] applies function [f] in turn to all - the elements of [a]. It is equivalent to - [f a.(0); f a.(1); ...; f a.(length a - 1); ()]. *) + the elements of [a]. It is equivalent to + [f a.(0); f a.(1); ...; f a.(length a - 1); ()]. *) val iteri : f:(int -> 'a -> unit) -> 'a t -> unit (** Same as {!Array.iter}, but the - function is applied with the index of the element as first argument, - and the element itself as second argument. *) + function is applied with the index of the element as first argument, + and the element itself as second argument. *) val blit : 'a t -> int -> 'a t -> int -> int -> unit (** [blit v1 o1 v2 o2 len] copies [len] elements - from array [v1], starting at element number [o1], to array [v2], - starting at element number [o2]. It works correctly even if - [v1] and [v2] are the same array, and the source and - destination chunks overlap. + from array [v1], starting at element number [o1], to array [v2], + starting at element number [o2]. It works correctly even if + [v1] and [v2] are the same array, and the source and + destination chunks overlap. - Raise [Invalid_argument "Array.blit"] if [o1] and [len] do not - designate a valid subarray of [v1], or if [o2] and [len] do not - designate a valid subarray of [v2]. *) + Raise [Invalid_argument "Array.blit"] if [o1] and [len] do not + designate a valid subarray of [v1], or if [o2] and [len] do not + designate a valid subarray of [v2]. *) val reverse_in_place : 'a t -> unit (** Reverse the array in place. *) @@ -153,8 +153,8 @@ val bsearch : cmp:('a -> 'a -> int) -> key:'a -> 'a t -> val for_all : f:('a -> bool) -> 'a t -> bool (** [for_all p [|a1; ...; an|]] checks if all elements of the array - satisfy the predicate [p]. That is, it returns - [(p a1) && (p a2) && ... && (p an)]. *) + satisfy the predicate [p]. That is, it returns + [(p a1) && (p a2) && ... && (p an)]. *) val for_all2 : f:('a -> 'b -> bool) -> 'a t -> 'b t -> bool (** Forall on pairs of arrays. @@ -207,13 +207,13 @@ val pp_i: ?sep:string -> (int -> 'a printer) -> 'a t printer val map : f:('a -> 'b) -> 'a t -> 'b t (** [map f a] applies function [f] to all the elements of [a], - and builds an array with the results returned by [f]: - [[| f a.(0); f a.(1); ...; f a.(length a - 1) |]]. *) + and builds an array with the results returned by [f]: + [[| f a.(0); f a.(1); ...; f a.(length a - 1) |]]. *) val map2 : f:('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t (** [map2 f a b] applies function [f] to all the elements of [a] and [b], - and builds an array with the results returned by [f]: - [[| f a.(0) b.(0); ...; f a.(length a - 1) b.(length b - 1)|]]. + and builds an array with the results returned by [f]: + [[| f a.(0) b.(0); ...; f a.(length a - 1) b.(length b - 1)|]]. @raise Invalid_argument if they have distinct lengths. @since 0.20 *) diff --git a/src/core/CCArray_slice.mli b/src/core/CCArray_slice.mli index 7dbb4bdb..577a3abe 100644 --- a/src/core/CCArray_slice.mli +++ b/src/core/CCArray_slice.mli @@ -22,12 +22,12 @@ val compare : 'a ord -> 'a t ord val get : 'a t -> int -> 'a (** [get a n] returns the element number [n] of array [a]. - The first element has number 0. - The last element has number [length a - 1]. - You can also write [a.(n)] instead of [get a n]. + The first element has number 0. + The last element has number [length a - 1]. + You can also write [a.(n)] instead of [get a n]. - Raise [Invalid_argument "index out of bounds"] - if [n] is outside the range 0 to [(length a - 1)]. *) + Raise [Invalid_argument "index out of bounds"] + if [n] is outside the range 0 to [(length a - 1)]. *) val get_safe : 'a t -> int -> 'a option (** [get_safe a i] returns [Some a.(i)] if [i] is a valid index. @@ -64,18 +64,18 @@ val sub : 'a t -> int -> int -> 'a t val set : 'a t -> int -> 'a -> unit (** [set a n x] modifies array [a] in place, replacing - element number [n] with [x]. - You can also write [a.(n) <- x] instead of [set a n x]. + element number [n] with [x]. + You can also write [a.(n) <- x] instead of [set a n x]. - Raise [Invalid_argument "index out of bounds"] - if [n] is outside the range 0 to [length a - 1]. *) + Raise [Invalid_argument "index out of bounds"] + if [n] is outside the range 0 to [length a - 1]. *) val length : _ t -> int (** Return the length (number of elements) of the given array. *) val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a (** [fold f x a] computes [f (... (f (f x a.(0)) a.(1)) ...) a.(n-1)], - where [n] is the length of the array [a]. *) + where [n] is the length of the array [a]. *) val foldi : ('a -> int -> 'b -> 'a) -> 'a -> 'b t -> 'a (** Fold left on array, with index. *) @@ -87,24 +87,24 @@ val fold_while : ('a -> 'b -> 'a * [`Stop | `Continue]) -> 'a -> 'b t -> 'a val iter : ('a -> unit) -> 'a t -> unit (** [iter f a] applies function [f] in turn to all - the elements of [a]. It is equivalent to - [f a.(0); f a.(1); ...; f a.(length a - 1); ()]. *) + the elements of [a]. It is equivalent to + [f a.(0); f a.(1); ...; f a.(length a - 1); ()]. *) val iteri : (int -> 'a -> unit) -> 'a t -> unit (** Same as {!Array.iter}, but the - function is applied with the index of the element as first argument, - and the element itself as second argument. *) + function is applied with the index of the element as first argument, + and the element itself as second argument. *) val blit : 'a t -> int -> 'a t -> int -> int -> unit (** [blit v1 o1 v2 o2 len] copies [len] elements - from array [v1], starting at element number [o1], to array [v2], - starting at element number [o2]. It works correctly even if - [v1] and [v2] are the same array, and the source and - destination chunks overlap. + from array [v1], starting at element number [o1], to array [v2], + starting at element number [o2]. It works correctly even if + [v1] and [v2] are the same array, and the source and + destination chunks overlap. - Raise [Invalid_argument "Array.blit"] if [o1] and [len] do not - designate a valid subarray of [v1], or if [o2] and [len] do not - designate a valid subarray of [v2]. *) + Raise [Invalid_argument "Array.blit"] if [o1] and [len] do not + designate a valid subarray of [v1], or if [o2] and [len] do not + designate a valid subarray of [v2]. *) val reverse_in_place : 'a t -> unit (** Reverse the array in place. *) @@ -177,8 +177,8 @@ val bsearch : cmp:('a -> 'a -> int) -> 'a -> 'a t -> val for_all : ('a -> bool) -> 'a t -> bool (** [for_all p [|a1; ...; an|]] checks if all elements of the array - satisfy the predicate [p]. That is, it returns - [(p a1) && (p a2) && ... && (p an)]. *) + satisfy the predicate [p]. That is, it returns + [(p a1) && (p a2) && ... && (p an)]. *) val for_all2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool (** Forall on pairs of arrays. diff --git a/src/core/CCChar.mli b/src/core/CCChar.mli index a36d11eb..b030d8bf 100644 --- a/src/core/CCChar.mli +++ b/src/core/CCChar.mli @@ -17,12 +17,12 @@ val compare : t -> t -> int val lowercase_ascii : t -> t (** Convert the given character to its equivalent lowercase character, - using the US-ASCII character set. + using the US-ASCII character set. @since 0.20 *) val uppercase_ascii : t -> t (** Convert the given character to its equivalent uppercase character, - using the US-ASCII character set. + using the US-ASCII character set. @since 0.20 *) val of_int_exn : int -> t diff --git a/src/core/CCInt64.mli b/src/core/CCInt64.mli index f6da0ba5..93e285b9 100644 --- a/src/core/CCInt64.mli +++ b/src/core/CCInt64.mli @@ -22,12 +22,12 @@ val ( * ) : t -> t -> t val (/) : t -> t -> t (** Integer division. Raise [Division_by_zero] if the second - argument is zero. This division rounds the real quotient of - its arguments towards zero, as specified for {!Pervasives.(/)}. *) + argument is zero. This division rounds the real quotient of + its arguments towards zero, as specified for {!Pervasives.(/)}. *) val (mod) : t -> t -> t (** Integer remainder. - If [y = 0], [x mod y] raises [Division_by_zero]. *) + If [y = 0], [x mod y] raises [Division_by_zero]. *) val abs : t -> t (** Return the absolute value of its argument. *) @@ -52,29 +52,29 @@ val lnot : t -> t val (lsl) : t -> int -> t (** [ x lsl y] shifts [x] to the left by [y] bits. - The result is unspecified if [y < 0] or [y >= 64]. *) + The result is unspecified if [y < 0] or [y >= 64]. *) val (lsr) : t -> int -> t (** [x lsr y] shifts [x] to the right by [y] bits. - This is a logical shift: zeroes are inserted in the vacated bits - regardless of the sign of [x]. - The result is unspecified if [y < 0] or [y >= 64]. *) + This is a logical shift: zeroes are inserted in the vacated bits + regardless of the sign of [x]. + The result is unspecified if [y < 0] or [y >= 64]. *) val (asr) : t -> int -> t (** [x asr y] shifts [x] to the right by [y] bits. - This is an arithmetic shift: the sign bit of [x] is replicated - and inserted in the vacated bits. - The result is unspecified if [y < 0] or [y >= 64]. *) + This is an arithmetic shift: the sign bit of [x] is replicated + and inserted in the vacated bits. + The result is unspecified if [y < 0] or [y >= 64]. *) val equal : t -> t -> bool (** The equal function for int64s. - Same as {!Pervasives.(=) x y)}. *) + Same as {!Pervasives.(=) x y)}. *) val compare : t -> t -> int (** The comparison function for 64-bit integers, with the same specification as - {!Pervasives.compare}. Along with the type [t], this function [compare] - allows the module [CCInt64] to be passed as argument to the functors - {!Set.Make} and {!Map.Make}. *) + {!Pervasives.compare}. Along with the type [t], this function [compare] + allows the module [CCInt64] to be passed as argument to the functors + {!Set.Make} and {!Map.Make}. *) val hash : t -> int (** Same as {!Pervasives.abs (to_int x)}. *) @@ -83,50 +83,50 @@ val hash : t -> int val to_int : t -> int (** Convert the given 64-bit integer (type [int64]) to an - integer (type [int]). On 64-bit platforms, the 64-bit integer - is taken modulo 2{^63}, i.e. the high-order bit is lost - during the conversion. On 32-bit platforms, the 64-bit integer - is taken modulo 2{^31}, i.e. the top 33 bits are lost - during the conversion. *) + integer (type [int]). On 64-bit platforms, the 64-bit integer + is taken modulo 2{^63}, i.e. the high-order bit is lost + during the conversion. On 32-bit platforms, the 64-bit integer + is taken modulo 2{^31}, i.e. the top 33 bits are lost + during the conversion. *) val of_int : int -> t option (** Safe version of {!of_int_exn}. *) val of_int_exn : int -> t (** Alias to {!Int64.of_int}. - Convert the given integer (type [int]) to a 64-bit integer - (type [int64]). - @raise Failure in case of failure. *) + Convert the given integer (type [int]) to a 64-bit integer + (type [int64]). + @raise Failure in case of failure. *) val to_int32 : t -> int32 (** Convert the given 64-bit integer (type [int64]) to a - 32-bit integer (type [int32]). The 64-bit integer - is taken modulo 2{^32}, i.e. the top 32 bits are lost - during the conversion. *) + 32-bit integer (type [int32]). The 64-bit integer + is taken modulo 2{^32}, i.e. the top 32 bits are lost + during the conversion. *) val of_int32 : int32 -> t option (** Safe version of {!of_int32_exn}. *) val of_int32_exn : int32 -> t (** Alias to {!Int64.of_int32} - Convert the given 32-bit integer (type [int32]) - to a 64-bit integer (type [int64]). - @raise Failure in case of failure. *) + Convert the given 32-bit integer (type [int32]) + to a 64-bit integer (type [int64]). + @raise Failure in case of failure. *) val to_nativeint : t -> nativeint (** Convert the given 64-bit integer (type [int64]) to a - native integer. On 32-bit platforms, the 64-bit integer - is taken modulo 2{^32}. On 64-bit platforms, - the conversion is exact. *) + native integer. On 32-bit platforms, the 64-bit integer + is taken modulo 2{^32}. On 64-bit platforms, + the conversion is exact. *) val of_nativeint : nativeint -> t option (** Safe version of {!of_nativeint_exn}. *) val of_nativeint_exn : nativeint -> t (** Alias to {!Int64.of_nativeint}. - Convert the given native integer (type [nativeint]) - to a 64-bit integer (type [int64]). - @raise Failure in case of failure. *) + Convert the given native integer (type [nativeint]) + to a 64-bit integer (type [int64]). + @raise Failure in case of failure. *) val to_float : t -> float (** Convert the given 64-bit integer to a floating-point number. *) @@ -136,10 +136,10 @@ val of_float : float -> t option val of_float_exn : float -> t (** Alias to {!Int64.of_float}. - Convert the given floating-point number to a 64-bit integer, - discarding the fractional part (truncate towards 0). - The result of the conversion is undefined if, after truncation, - the number is outside the range \[{!CCInt64.min_int}, {!CCInt64.max_int}\]. + Convert the given floating-point number to a 64-bit integer, + discarding the fractional part (truncate towards 0). + The result of the conversion is undefined if, after truncation, + the number is outside the range \[{!CCInt64.min_int}, {!CCInt64.max_int}\]. @raise Failure in case of failure. *) val to_string : t -> string @@ -150,18 +150,18 @@ val of_string : string -> t option val of_string_exn : string -> t (** Alias to {!Int64.of_string}. - Convert the given string to a 64-bit integer. - The string is read in decimal (by default, or if the string - begins with [0u]) or in hexadecimal, octal or binary if the - string begins with [0x], [0o] or [0b] respectively. + Convert the given string to a 64-bit integer. + The string is read in decimal (by default, or if the string + begins with [0u]) or in hexadecimal, octal or binary if the + string begins with [0x], [0o] or [0b] respectively. - The [0u] prefix reads the input as an unsigned integer in the range - [[0, 2*CCInt64.max_int+1]]. If the input exceeds {!CCInt64.max_int} - it is converted to the signed integer - [CCInt64.min_int + input - CCInt64.max_int - 1]. + The [0u] prefix reads the input as an unsigned integer in the range + [[0, 2*CCInt64.max_int+1]]. If the input exceeds {!CCInt64.max_int} + it is converted to the signed integer + [CCInt64.min_int + input - CCInt64.max_int - 1]. - The [_] (underscore) character can appear anywhere in the string - and is ignored. - Raise [Failure "Int64.of_string"] if the given string is not - a valid representation of an integer, or if the integer represented - exceeds the range of integers representable in type [int64]. *) + The [_] (underscore) character can appear anywhere in the string + and is ignored. + Raise [Failure "Int64.of_string"] if the given string is not + a valid representation of an integer, or if the integer represented + exceeds the range of integers representable in type [int64]. *) diff --git a/src/core/CCList.ml b/src/core/CCList.ml index a3219a4c..064070d8 100644 --- a/src/core/CCList.ml +++ b/src/core/CCList.ml @@ -1017,7 +1017,7 @@ let uniq ~eq l = (*$Q Q.(small_list small_int) (fun l -> \ sort_uniq ~cmp:CCInt.compare l = (uniq ~eq:CCInt.equal l |> sort Pervasives.compare)) - *) +*) let union ~eq l1 l2 = let rec union eq acc l1 l2 = match l1 with @@ -1065,8 +1065,8 @@ let iteri2 f l1 l2 = | [], _ | _, [] -> invalid_arg "iteri2" | x1::l1', x2::l2' -> - f i x1 x2; - aux f (i+1) l1' l2' + f i x1 x2; + aux f (i+1) l1' l2' in aux f 0 l1 l2 let foldi f acc l = diff --git a/src/core/CCList.mli b/src/core/CCList.mli index 0f4317d7..d0a85896 100644 --- a/src/core/CCList.mli +++ b/src/core/CCList.mli @@ -32,7 +32,7 @@ val cons : 'a -> 'a t -> 'a t val append : 'a t -> 'a t -> 'a t (** Safe version of {!List.append}. - Concatenate two lists. *) + Concatenate two lists. *) val cons_maybe : 'a option -> 'a t -> 'a t (** [cons_maybe (Some x) l] is [x :: l]. @@ -41,18 +41,18 @@ val cons_maybe : 'a option -> 'a t -> 'a t val (@) : 'a t -> 'a t -> 'a t (** Same as [append]. - Concatenate two lists. *) + Concatenate two lists. *) val filter : ('a -> bool) -> 'a t -> 'a t (** Safe version of {!List.filter}. - [filter p l] returns all the elements of the list [l] - that satisfy the predicate [p]. The order of the elements - in the input list is preserved. *) + [filter p l] returns all the elements of the list [l] + that satisfy the predicate [p]. The order of the elements + in the input list is preserved. *) val fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b (** Safe version of [fold_right]. - [fold_right f [a1; ...; an] b] is - [f a1 (f a2 (... (f an b) ...))]. Not tail-recursive. *) + [fold_right f [a1; ...; an] b] is + [f a1 (f a2 (... (f an b) ...))]. Not tail-recursive. *) val fold_while : ('a -> 'b -> 'a * [`Stop | `Continue]) -> 'a -> 'b t -> 'a (** Fold until a stop condition via [('a, `Stop)] is @@ -95,9 +95,9 @@ val init : int -> (int -> 'a) -> 'a t val combine : 'a list -> 'b list -> ('a * 'b) list (** Similar to {!List.combine} but tail-recursive. - Transform a pair of lists into a list of pairs: - [combine [a1; ...; an] [b1; ...; bn]] is - [[(a1,b1); ...; (an,bn)]]. + Transform a pair of lists into a list of pairs: + [combine [a1; ...; an] [b1; ...; bn]] is + [[(a1,b1); ...; (an,bn)]]. @raise Invalid_argument if the lists have distinct lengths. @since 1.2 *) @@ -110,20 +110,20 @@ val combine_gen : 'a list -> 'b list -> ('a * 'b) gen val split : ('a * 'b) t -> 'a t * 'b t (** A tail-recursive version of {!List.split}. - Transform a list of pairs into a pair of lists: - [split [(a1,b1); ...; (an,bn)]] is [([a1; ...; an], [b1; ...; bn])]. *) + Transform a list of pairs into a pair of lists: + [split [(a1,b1); ...; (an,bn)]] is [([a1; ...; an], [b1; ...; bn])]. *) val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val compare_lengths : 'a t -> 'b t -> int (** Equivalent to [compare (length l1) (length l2)] but more efficient. - Compare the lengths of two lists. - @since 1.5 *) + Compare the lengths of two lists. + @since 1.5 *) val compare_length_with : 'a t -> int -> int (** Equivalent to [compare (length l) x] but more efficient. - Compare the length of a list to an integer. - @since 1.5 *) + Compare the length of a list to an integer. + @since 1.5 *) val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool @@ -144,13 +144,13 @@ val cartesian_product : 'a t t -> 'a t t by returning all the ways of picking one element per sublist. {b NOTE} the order of the returned list is unspecified. For example: - {[ - # cartesian_product [[1;2];[3];[4;5;6]] |> sort = - [[1;3;4];[1;3;5];[1;3;6];[2;3;4];[2;3;5];[2;3;6]];; - # cartesian_product [[1;2];[];[4;5;6]] = [];; - # cartesian_product [[1;2];[3];[4];[5];[6]] |> sort = - [[1;3;4;5;6];[2;3;4;5;6]];; - ]} + {[ + # cartesian_product [[1;2];[3];[4;5;6]] |> sort = + [[1;3;4];[1;3;5];[1;3;6];[2;3;4];[2;3;5];[2;3;6]];; + # cartesian_product [[1;2];[];[4;5;6]] = [];; + # cartesian_product [[1;2];[3];[4];[5];[6]] |> sort = + [[1;3;4;5;6];[2;3;4;5;6]];; + ]} invariant: [cartesian_product l = map_product id l]. @since 1.2 *) @@ -353,13 +353,13 @@ val group_succ : eq:('a -> 'a -> bool) -> 'a list -> 'a list list val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t (** Same as {!map}, but the function is applied to the index of - the element as first argument (counting from 0), and the element - itself as second argument. *) - + the element as first argument (counting from 0), and the element + itself as second argument. *) + val iteri : (int -> 'a -> unit) -> 'a t -> unit (** Same as {!iter}, but the function is applied to the index of - the element as first argument (counting from 0), and the element - itself as second argument. *) + the element as first argument (counting from 0), and the element + itself as second argument. *) val iteri2 : (int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit (** @raise Invalid_argument when lists do not have the same length. @@ -591,7 +591,7 @@ val of_klist : 'a klist -> 'a t (** {2 Infix Operators} It is convenient to {!open CCList.Infix} to access the infix operators without cluttering the scope too much. - + @since 0.16 *) module Infix : sig diff --git a/src/core/CCListLabels.mli b/src/core/CCListLabels.mli index 1df97d39..60435e1c 100644 --- a/src/core/CCListLabels.mli +++ b/src/core/CCListLabels.mli @@ -26,7 +26,7 @@ val cons : 'a -> 'a t -> 'a t val append : 'a t -> 'a t -> 'a t (** Safe version of {!List.append}. - Concatenate two lists. *) + Concatenate two lists. *) val cons_maybe : 'a option -> 'a t -> 'a t (** [cons_maybe (Some x) l] is [x :: l]. @@ -35,7 +35,7 @@ val cons_maybe : 'a option -> 'a t -> 'a t val (@) : 'a t -> 'a t -> 'a t (** Same as [append]. - Concatenate two lists. *) + Concatenate two lists. *) val filter : f:('a -> bool) -> 'a t -> 'a t (** Safe version of {!List.filter}. *) @@ -240,13 +240,13 @@ val group_succ : eq:('a -> 'a -> bool) -> 'a list -> 'a list list val mapi : f:(int -> 'a -> 'b) -> 'a t -> 'b t (** Same as {!map}, but the function is applied to the index of - the element as first argument (counting from 0), and the element - itself as second argument. *) + the element as first argument (counting from 0), and the element + itself as second argument. *) val iteri : f:(int -> 'a -> unit) -> 'a t -> unit (** Same as {!iter}, but the function is applied to the index of - the element as first argument (counting from 0), and the element - itself as second argument. *) + the element as first argument (counting from 0), and the element + itself as second argument. *) val foldi : f:('b -> int -> 'a -> 'b) -> init:'b -> 'a t -> 'b (** Fold on list, with index. *) diff --git a/src/core/CCString.ml b/src/core/CCString.ml index 42e0c69c..219cd554 100644 --- a/src/core/CCString.ml +++ b/src/core/CCString.ml @@ -775,7 +775,7 @@ let exists2 p s1 s2 = try iter2 (fun c1 c2 -> if p c1 c2 then raise MyExit) s1 s2; false with MyExit -> true - (** {2 Ascii functions} *) +(** {2 Ascii functions} *) let equal_caseless s1 s2: bool = String.length s1 = String.length s2 && diff --git a/src/data/CCWBTree.mli b/src/data/CCWBTree.mli index 3300c17a..c6f13f98 100644 --- a/src/data/CCWBTree.mli +++ b/src/data/CCWBTree.mli @@ -128,7 +128,7 @@ module type S = sig val pp : key printer -> 'a printer -> 'a t printer (** Renamed from [val print]. - @since NEXT_RELEASE *) + @since NEXT_RELEASE *) (**/**) val node_ : key -> 'a -> 'a t -> 'a t -> 'a t diff --git a/src/mkflags.ml b/src/mkflags.ml index 591df576..d781110e 100644 --- a/src/mkflags.ml +++ b/src/mkflags.ml @@ -1,13 +1,13 @@ - let () = - let major, minor = - Scanf.sscanf Sys.ocaml_version "%u.%u" - (fun major minor -> major, minor) - in - let after_4_3 = (major, minor) >= (4, 3) in - let flags_file = open_out "flambda.flags" in - if after_4_3 then ( - output_string flags_file "(-O3 -unbox-closures -unbox-closures-factor 20 -color always)\n"; - ) else ( - output_string flags_file "()\n"; - ); - close_out flags_file +let () = + let major, minor = + Scanf.sscanf Sys.ocaml_version "%u.%u" + (fun major minor -> major, minor) + in + let after_4_3 = (major, minor) >= (4, 3) in + let flags_file = open_out "flambda.flags" in + if after_4_3 then ( + output_string flags_file "(-O3 -unbox-closures -unbox-closures-factor 20 -color always)\n"; + ) else ( + output_string flags_file "()\n"; + ); + close_out flags_file diff --git a/src/threads/CCPool.ml b/src/threads/CCPool.ml index 3f186243..fd9c21a1 100644 --- a/src/threads/CCPool.ml +++ b/src/threads/CCPool.ml @@ -146,8 +146,8 @@ module Make(P : PARAM) = struct Condition.broadcast pool.cond; (* wake up some worker, if any *) (* might want to process in the background, if all threads are busy *) if not (Queue.is_empty pool.jobs) - && pool.cur_idle = 0 - && can_start_thread_ pool then ( + && pool.cur_idle = 0 + && can_start_thread_ pool then ( launch_worker_ pool; ) ))