diff --git a/src/advanced/CCBatch.ml b/src/advanced/CCBatch.ml index 760982e6..4f2e7cd6 100644 --- a/src/advanced/CCBatch.ml +++ b/src/advanced/CCBatch.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, Simon Cruanes, Gabriel Radanne all rights reserved. @@ -41,7 +40,7 @@ module type S = sig type 'a t type ('a,'b) op - (** Operation that converts an ['a t] into a ['b t] *) + (** Operation that converts a ['a t] into a ['b t] *) val apply : ('a,'b) op -> 'a t -> 'b t (** Apply the operation to the collection. *) @@ -170,7 +169,7 @@ module Make(C : COLLECTION) = struct | OptExtern _ -> OptFlatMap (f, op) | OptBase _ -> OptFlatMap (f, op) - (* optimize a batch operation by fusion *) + (* Optimize a batch operation by fusion *) let optimize : type a b. (a,b) op -> (a,b) optimized_op = fun op -> match op with | Compose (a, b) -> optimize_compose a b @@ -213,7 +212,7 @@ module Make(C : COLLECTION) = struct | OptExtern (f,c) -> apply_optimized_with_fold c fold z (f a) | OptFlatMap (f,c) -> apply_optimized_with_fold c fold z (C.flat_map f a) - (* optimize and run *) + (* Optimize and run *) let apply op a = let op' = optimize op in apply_optimized op' a diff --git a/src/advanced/CCBatch.mli b/src/advanced/CCBatch.mli index 7b04b692..6f68fa07 100644 --- a/src/advanced/CCBatch.mli +++ b/src/advanced/CCBatch.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -47,7 +46,7 @@ module type S = sig type 'a t type ('a,'b) op - (** Operation that converts an ['a t] into a ['b t] *) + (** Operation that converts a ['a t] into a ['b t] *) val apply : ('a,'b) op -> 'a t -> 'b t (** Apply the operation to the collection. *) diff --git a/src/advanced/CCCat.ml b/src/advanced/CCCat.ml index cb9ab343..0bbc6b50 100644 --- a/src/advanced/CCCat.ml +++ b/src/advanced/CCCat.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/advanced/CCCat.mli b/src/advanced/CCCat.mli index 1f136322..bcb86c32 100644 --- a/src/advanced/CCCat.mli +++ b/src/advanced/CCCat.mli @@ -111,4 +111,3 @@ module MakeFree(F : FUNCTOR) : FREE_MONAD with module F = F module MakeFreeFold(FM : FREE_MONAD)(Fold : FOLDABLE with type 'a t = 'a FM.F.t) : FOLDABLE with type 'a t = 'a FM.t - diff --git a/src/advanced/CCLinq.ml b/src/advanced/CCLinq.ml index 7e76203a..06d2fe0e 100644 --- a/src/advanced/CCLinq.ml +++ b/src/advanced/CCLinq.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -41,7 +40,7 @@ let _error_of_exn f = try `Ok (f ()) with ExitWithError s -> `Error s module PMap = struct type ('a, 'b) t = { is_empty : unit -> bool; - size : unit -> int; (** Number of keys *) + size : unit -> int; (* Number of keys *) get : 'a -> 'b option; fold : 'c. ('c -> 'a -> 'b -> 'c) -> 'c -> 'c; to_seq : ('a * 'b) sequence; diff --git a/src/advanced/CCLinq.mli b/src/advanced/CCLinq.mli index 8339c20b..cf21c35e 100644 --- a/src/advanced/CCLinq.mli +++ b/src/advanced/CCLinq.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -26,7 +25,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (** {1 LINQ-like operations on collections} -The purpose it to provide powerful combinators to express iteration, +The purpose is to provide powerful combinators to express iteration, transformation and combination of collections of items. This module depends on several other modules, including {!CCList} and {!CCSequence}. @@ -109,7 +108,7 @@ module PMap : sig (** View a multimap as a collection of individual key/value pairs *) val flatten_l : ('a,'b list) t -> ('a*'b) sequence - (** View a multimap as a collection of individual key/value pairs *) + (** View a multimap as a list of individual key/value pairs *) end (** {2 Query operators} *) @@ -161,7 +160,7 @@ val run : ?limit:int -> 'a t -> 'a sequence val run1 : 'a t -> 'a (** Run the query and return the first value - @raise Not_found if the query succeeds with 0 elements *) + @raise Not_found if the query succeeds with 0 element *) val run_no_optim : ?limit:int -> 'a t -> 'a sequence (** Run without any optimization *) @@ -169,7 +168,7 @@ val run_no_optim : ?limit:int -> 'a t -> 'a sequence (** {6 Basics} *) val map : ('a -> 'b) -> 'a t -> 'b t -(** map each value *) +(** Map each value *) val (>|=) : 'a t -> ('a -> 'b) -> 'b t (** Infix synonym of {!map} *) @@ -193,17 +192,15 @@ val flat_map : ('a -> 'b sequence) -> 'a t -> 'b t val flat_map_l : ('a -> 'b list) -> 'a t -> 'b t (** map each element to a collection and flatten the result *) -val flat_map_l : ('a -> 'b list) -> 'a t -> 'b t - val flatten : 'a list t -> 'a t val flatten_seq : 'a sequence t -> 'a t val take : int -> 'a t -> 'a t -(** take at most [n] elements *) +(** Take at most [n] elements *) val take_while : ('a -> bool) -> 'a t -> 'a t -(** take elements while they satisfy a predicate *) +(** Take elements while they satisfy a predicate *) val sort : ?cmp:'a ord -> unit -> 'a t -> 'a t (** Sort items by the given comparison function *) @@ -327,7 +324,7 @@ Careful, those operators do not allow any optimization before running the query, they might therefore be pretty slow. *) val bind : ('a -> 'b t) -> 'a t -> 'b t -(** Use the result of a query to build another query and imediately run it. *) +(** Use the result of a query to build another query and immediately run it. *) val (>>=) : 'a t -> ('a -> 'b t) -> 'b t (** Infix version of {!bind} *) diff --git a/src/advanced/CCMonadIO.cppo.ml b/src/advanced/CCMonadIO.cppo.ml index b4658b15..109cf716 100644 --- a/src/advanced/CCMonadIO.cppo.ml +++ b/src/advanced/CCMonadIO.cppo.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -518,5 +517,3 @@ end module Raw = struct let wrap f = Wrap f end - -(* vim:ft=ocaml: *) diff --git a/src/advanced/CCMonadIO.mli b/src/advanced/CCMonadIO.mli index 36ef97fb..aac8cb4a 100644 --- a/src/advanced/CCMonadIO.mli +++ b/src/advanced/CCMonadIO.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -66,7 +65,7 @@ type 'a with_finalizer type 'a or_error = [ `Ok of 'a | `Error of string ] val (>>=) : 'a t -> ('a -> 'b t) -> 'b t -(** wait for the result of an action, then use a function to build a +(** Wait for the result of an action, then use a function to build a new action and execute it *) val return : 'a -> 'a t @@ -309,7 +308,7 @@ module File : sig explored *) val walk : t -> ([`File | `Dir] * t) Seq.t io - (** similar to {!read_dir} (with [recurse=true]), this function walks + (** Similar to {!read_dir} (with [recurse=true]), this function walks a directory recursively and yields either files or directories. Is a file anything that doesn't satisfy {!is_directory} (including symlinks, etc.) *) diff --git a/src/advanced/containers_advanced.ml b/src/advanced/containers_advanced.ml index fc460343..555b92e5 100644 --- a/src/advanced/containers_advanced.ml +++ b/src/advanced/containers_advanced.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. diff --git a/src/bigarray/CCArray1.ml b/src/bigarray/CCArray1.ml index 140e2792..559a4361 100644 --- a/src/bigarray/CCArray1.ml +++ b/src/bigarray/CCArray1.ml @@ -1,5 +1,3 @@ - - (* copyright (c) 2013-2015, simon cruanes all rights reserved. diff --git a/src/bigarray/CCArray1.mli b/src/bigarray/CCArray1.mli index 1a6dab57..ebde558e 100644 --- a/src/bigarray/CCArray1.mli +++ b/src/bigarray/CCArray1.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -101,7 +100,7 @@ val set : ('a, _, [>`W]) t -> int -> 'a -> unit (** set n-th element *) val get : ('a, _, [>`R]) t -> int -> 'a -(** get n-th element *) +(** Get n-th element *) val fill : ('a, _, [>`W]) t -> 'a -> unit (** [fill a x] fills [a] with [x] *) @@ -329,7 +328,7 @@ module View : sig (** See {!select} *) val foldi : ('b -> int -> 'a -> 'b) -> 'b -> 'a t -> 'b - (** fold on values with their index *) + (** Fold on values with their index *) val iteri : f:(int -> 'a -> unit) -> 'a t -> unit (** [iteri ~f v] iterates on elements of [v] with their index *) @@ -367,5 +366,3 @@ module View : sig (** [to_array v] returns a fresh copy of the content of [v]. Exactly one of [res] and [kind] must be provided *) end - - diff --git a/src/bigarray/CCBigstring.ml b/src/bigarray/CCBigstring.ml index 093466c7..a22fe168 100644 --- a/src/bigarray/CCBigstring.ml +++ b/src/bigarray/CCBigstring.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/bigarray/CCBigstring.mli b/src/bigarray/CCBigstring.mli index ddd07fcb..6eb0143b 100644 --- a/src/bigarray/CCBigstring.mli +++ b/src/bigarray/CCBigstring.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCArray.ml b/src/core/CCArray.ml index 17b351d5..6c1d2098 100644 --- a/src/core/CCArray.ml +++ b/src/core/CCArray.ml @@ -78,7 +78,7 @@ module type S = sig @since 0.3.4 *) val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option - (** [find p x] returns [Some (i,x)] where [x] is the [i]-th element of [l], + (** [find_idx p x] returns [Some (i,x)] where [x] is the [i]-th element of [l], and [p x] holds. Otherwise returns [None] @since 0.3.4 *) @@ -152,7 +152,7 @@ module type S = sig end (** {2 General Implementation} -Most of those functions that a range [(i,j)] with +Most of those functions use a range [(i,j)] with [i] included and [j] excluded *) let rec _foldi f acc a i j = @@ -570,7 +570,7 @@ module Sub = struct let set a i x = let j = a.i + i in - if i<0 || j>=a.j then invalid_arg "Array.Sub.get"; + if i<0 || j>=a.j then invalid_arg "Array.Sub.set"; a.arr.(j) <- x let iter f a = @@ -655,7 +655,7 @@ module type MONO_ARRAY = sig val set : t -> int -> elt -> unit end -(* Dual Pivot Quicksort (YaroslavSkiy) +(* Dual Pivot Quicksort (Yaroslavskiy) from "average case analysis of Java 7's Dual Pivot Quicksort" *) module SortGeneric(A : MONO_ARRAY) = struct module Rand = Random.State @@ -774,4 +774,3 @@ let sort_generic (type arr)(type elt) Array.sort CCInt.compare a1; sort_generic ~cmp:CCInt.compare (module IA) a2; \ a1 = a2 ) *) - diff --git a/src/core/CCArray.mli b/src/core/CCArray.mli index 2a84b628..c23ed39e 100644 --- a/src/core/CCArray.mli +++ b/src/core/CCArray.mli @@ -80,7 +80,7 @@ module type S = sig @since 0.3.4 *) val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option - (** [find p x] returns [Some (i,x)] where [x] is the [i]-th element of [l], + (** [find_idx p x] returns [Some (i,x)] where [x] is the [i]-th element of [l], and [p x] holds. Otherwise returns [None] @since 0.3.4 *) @@ -125,7 +125,7 @@ module type S = sig @raise Invalid_argument if they have distinct lengths *) val shuffle : 'a t -> unit - (** shuffle randomly the array, in place *) + (** Shuffle randomly the array, in place *) val shuffle_with : Random.State.t -> 'a t -> unit (** Like shuffle but using a specialized random state *) @@ -142,15 +142,15 @@ module type S = sig val pp: ?sep:string -> (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a t -> unit - (** print an array of items with printing function *) + (** Print an array of items with printing function *) val pp_i: ?sep:string -> (Buffer.t -> int -> 'a -> unit) -> Buffer.t -> 'a t -> unit - (** print an array, giving the printing function both index and item *) + (** Print an array, giving the printing function both index and item *) val print : ?sep:string -> (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit - (** print an array of items with printing function *) + (** Print an array of items with printing function *) end (** {2 Arrays} *) @@ -169,7 +169,7 @@ val filter_map : ('a -> 'b option) -> 'a t -> 'b t (** Map each element into another value, or discard it *) val flat_map : ('a -> 'b t) -> 'a t -> 'b array -(** transform each element into an array, then flatten *) +(** Transform each element into an array, then flatten *) val (>>=) : 'a t -> ('a -> 'b t) -> 'b t (** Infix version of {!flat_map} *) @@ -251,4 +251,3 @@ val sort_generic : (** Sort the array, without allocating (eats stack space though). Performance might be lower than {!Array.sort}. @since 0.14 *) - diff --git a/src/core/CCBool.ml b/src/core/CCBool.ml index ac61291f..148961ac 100644 --- a/src/core/CCBool.ml +++ b/src/core/CCBool.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCBool.mli b/src/core/CCBool.mli index 25e09dba..28108f89 100644 --- a/src/core/CCBool.mli +++ b/src/core/CCBool.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -43,4 +42,3 @@ val pp : t printer (** Printer for booleans *) val print : t formatter - diff --git a/src/core/CCChar.ml b/src/core/CCChar.ml index 8f4db0d6..a1622930 100644 --- a/src/core/CCChar.ml +++ b/src/core/CCChar.ml @@ -11,5 +11,3 @@ let compare = Char.compare let pp = Buffer.add_char let print = Format.pp_print_char - - diff --git a/src/core/CCChar.mli b/src/core/CCChar.mli index 3f12e666..1ca8dcd3 100644 --- a/src/core/CCChar.mli +++ b/src/core/CCChar.mli @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Utils around char} @@ -12,4 +11,3 @@ val compare : t -> t -> int val pp : Buffer.t -> t -> unit val print : Format.formatter -> t -> unit - diff --git a/src/core/CCError.ml b/src/core/CCError.ml index 20746abd..a587ccef 100644 --- a/src/core/CCError.ml +++ b/src/core/CCError.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCError.mli b/src/core/CCError.mli index b01af19f..30d9810a 100644 --- a/src/core/CCError.mli +++ b/src/core/CCError.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -26,7 +25,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. (** {1 Error Monad} -The variant is polymorphic in the error type since 0.5 *) +The variant is polymorphic in the error type +@since 0.5 *) type 'a sequence = ('a -> unit) -> unit type 'a equal = 'a -> 'a -> bool @@ -108,7 +108,8 @@ val fold : success:('a -> 'b) -> failure:('err -> 'b) -> ('a, 'err) t -> 'b (** {2 Wrappers} The functions {!guard}, {!wrap1}, {!wrap2} and {!wrap3} now return -exceptions in case of failure, @since 0.5 *) +exceptions in case of failure, +@since 0.5 *) val guard : (unit -> 'a) -> ('a, exn) t (** [guard f] runs [f ()] and returns its result wrapped in [`Ok]. If @@ -130,6 +131,7 @@ val wrap2 : ('a -> 'b -> 'c) -> 'a -> 'b -> ('c, exn) t (** Same as {!guard} but gives the function two arguments. *) val wrap3 : ('a -> 'b -> 'c -> 'd) -> 'a -> 'b -> 'c -> ('d, exn) t +(** Same as {!guard} but gives the function three arguments. *) (** {2 Applicative} *) diff --git a/src/core/CCFloat.ml b/src/core/CCFloat.ml index 010e3882..b73b311b 100644 --- a/src/core/CCFloat.ml +++ b/src/core/CCFloat.ml @@ -84,7 +84,7 @@ let fsign a = exception TrapNaN of string let sign_exn (a:float) = - if is_nan a then raise (TrapNaN "sign") + if is_nan a then raise (TrapNaN "sign_exn") else compare a 0. let to_int (a:float) = Pervasives.int_of_float a @@ -101,4 +101,3 @@ let random_range i j st = i +. random (j-.i) st let equal_precision ~epsilon a b = abs_float (a-.b) < epsilon let classify = Pervasives.classify_float - diff --git a/src/core/CCFormat.ml b/src/core/CCFormat.ml index c294d91a..bdb425d6 100644 --- a/src/core/CCFormat.ml +++ b/src/core/CCFormat.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. diff --git a/src/core/CCFormat.mli b/src/core/CCFormat.mli index c27e0eb8..bb7279d6 100644 --- a/src/core/CCFormat.mli +++ b/src/core/CCFormat.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. @@ -35,7 +34,7 @@ type 'a printer = t -> 'a -> unit (** {2 Combinators} *) -val silent : 'a printer (** prints nothing *) +val silent : 'a printer (** Prints nothing *) val unit : unit printer val int : int printer diff --git a/src/core/CCFun.cppo.ml b/src/core/CCFun.cppo.ml index e9568b35..77f12094 100644 --- a/src/core/CCFun.cppo.ml +++ b/src/core/CCFun.cppo.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCFun.mli b/src/core/CCFun.mli index 1a371705..b6abcf08 100644 --- a/src/core/CCFun.mli +++ b/src/core/CCFun.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -52,7 +51,7 @@ val const : 'a -> 'b -> 'a (** [const x y = x] for any [y] *) val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c -(** flip arguments *) +(** Flip arguments *) val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c @@ -80,7 +79,7 @@ val finally : h:(unit -> unit) -> f:(unit -> 'a) -> 'a (** {2 Monad} -functions with a fixed domain are monads in their codomain *) +Functions with a fixed domain are monads in their codomain *) module Monad(X : sig type t end) : sig type 'a t = X.t -> 'a diff --git a/src/core/CCHashtbl.ml b/src/core/CCHashtbl.ml index 58bf360d..73819dd3 100644 --- a/src/core/CCHashtbl.ml +++ b/src/core/CCHashtbl.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -118,11 +117,11 @@ module type S = sig (** Iterate on values in the table *) val keys_list : ('a, 'b) Hashtbl.t -> 'a list - (** [keys t] is the list of keys in [t]. + (** [keys_list t] is the list of keys in [t]. @since 0.8 *) val values_list : ('a, 'b) Hashtbl.t -> 'b list - (** [values t] is the list of values in [t]. + (** [values_list t] is the list of values in [t]. @since 0.8 *) val map_list : (key -> 'a -> 'b) -> 'a t -> 'b list diff --git a/src/core/CCHashtbl.mli b/src/core/CCHashtbl.mli index d4079c5a..826bc636 100644 --- a/src/core/CCHashtbl.mli +++ b/src/core/CCHashtbl.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -46,11 +45,11 @@ val values : ('a,'b) Hashtbl.t -> 'b sequence (** Iterate on values in the table *) val keys_list : ('a, 'b) Hashtbl.t -> 'a list -(** [keys t] is the list of keys in [t]. +(** [keys_list t] is the list of keys in [t]. @since 0.8 *) val values_list : ('a, 'b) Hashtbl.t -> 'b list -(** [values t] is the list of values in [t]. +(** [values_list t] is the list of values in [t]. @since 0.8 *) val map_list : ('a -> 'b -> 'c) -> ('a, 'b) Hashtbl.t -> 'c list @@ -227,4 +226,5 @@ module MakeCounter(X : Hashtbl.HashedType) with type elt = X.t and type t = int Hashtbl.Make(X).t (** Create a new counter type - The type [t] is exposed @since 0.14 *) + The type [t] is exposed + @since 0.14 *) diff --git a/src/core/CCIO.ml b/src/core/CCIO.ml index 87113cb7..d0a7daf4 100644 --- a/src/core/CCIO.ml +++ b/src/core/CCIO.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCIO.mli b/src/core/CCIO.mli index 44e8e257..442b832b 100644 --- a/src/core/CCIO.mli +++ b/src/core/CCIO.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -112,7 +111,7 @@ val write_line : out_channel -> string -> unit val write_gen : ?sep:string -> out_channel -> string gen -> unit (** Write the given strings on the output. If provided, add [sep] between - every two string (but not at the end) *) + every two strings (but not at the end) *) val write_lines : out_channel -> string gen -> unit (** Write every string on the output, followed by "\n". *) @@ -188,7 +187,7 @@ module File : sig type walk_item = [`File | `Dir] * t val walk : t -> walk_item gen - (** similar to {!read_dir} (with [recurse=true]), this function walks + (** Similar to {!read_dir} (with [recurse=true]), this function walks a directory recursively and yields either files or directories. Is a file anything that doesn't satisfy {!is_directory} (including symlinks, etc.) *) diff --git a/src/core/CCInt.ml b/src/core/CCInt.ml index 3d1cc631..bc535eca 100644 --- a/src/core/CCInt.ml +++ b/src/core/CCInt.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -48,7 +47,7 @@ let pow a b = else acc * (aux (acc*acc) (n/2)) in match b with - | 0 -> if a = 0 then raise (Invalid_argument "Undefined value 0^0") else 1 + | 0 -> if a = 0 then raise (Invalid_argument "pow: undefined value 0^0") else 1 | b when b < 0 -> raise (Invalid_argument "pow: can't raise int to negative power") | b -> aux a b diff --git a/src/core/CCInt.mli b/src/core/CCInt.mli index 1a373a56..f81669f9 100644 --- a/src/core/CCInt.mli +++ b/src/core/CCInt.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -43,7 +42,7 @@ val neg : t -> t val pow : t -> t -> t (** [pow a b = a^b] for positive integers [a] and [b]. - raises [Invalid_argument] if [a = b = 0] or [b] < 0. + Raises [Invalid_argument] if [a = b = 0] or [b] < 0. @since 0.11 *) type 'a printer = Buffer.t -> 'a -> unit @@ -62,4 +61,3 @@ val to_string : t -> string val of_string : string -> t option (** @since 0.13 *) - diff --git a/src/core/CCInt64.ml b/src/core/CCInt64.ml index d21c14a8..f9ab3841 100644 --- a/src/core/CCInt64.ml +++ b/src/core/CCInt64.ml @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) include Int64 diff --git a/src/core/CCInt64.mli b/src/core/CCInt64.mli index 08215c60..5074fc0c 100644 --- a/src/core/CCInt64.mli +++ b/src/core/CCInt64.mli @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Int64} @@ -78,4 +77,3 @@ val to_string : t -> string val of_string : string -> t option val of_string_exn : string -> t - diff --git a/src/core/CCList.ml b/src/core/CCList.ml index f6239ecd..4d697262 100644 --- a/src/core/CCList.ml +++ b/src/core/CCList.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCList.mli b/src/core/CCList.mli index 5158730e..2f49619f 100644 --- a/src/core/CCList.mli +++ b/src/core/CCList.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -72,8 +71,8 @@ val fold_map : ('acc -> 'a -> 'acc * 'b) -> 'acc -> 'a list -> 'acc * 'b list @since 0.14 *) val fold_flat_map : ('acc -> 'a -> 'acc * 'b list) -> 'acc -> 'a list -> 'acc * 'b list -(** [fold_map f acc l] is a [fold_left]-like function, but it also maps the - list to a list of list that is then [flatten]'d.. +(** [fold_flat_map f acc l] is a [fold_left]-like function, but it also maps the + list to a list of lists that is then [flatten]'d.. @since 0.14 *) val init : int -> (int -> 'a) -> 'a t @@ -85,13 +84,13 @@ val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool val flat_map : ('a -> 'b t) -> 'a t -> 'b t -(** map and flatten at the same time (safe). Evaluation order is not guaranteed. *) +(** Map and flatten at the same time (safe). Evaluation order is not guaranteed. *) val flatten : 'a t t -> 'a t (** Safe flatten *) val product : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t -(** cartesian product of the two lists, with the given combinator *) +(** Cartesian product of the two lists, with the given combinator *) val fold_product : ('c -> 'a -> 'b -> 'c) -> 'c -> 'a t -> 'b t -> 'c (** Fold on the cartesian product *) @@ -119,10 +118,10 @@ val return : 'a -> 'a t val (>>=) : 'a t -> ('a -> 'b t) -> 'b t val take : int -> 'a t -> 'a t -(** take the [n] first elements, drop the rest *) +(** Take the [n] first elements, drop the rest *) val drop : int -> 'a t -> 'a t -(** drop the [n] first elements, keep the rest *) +(** Drop the [n] first elements, keep the rest *) val take_drop : int -> 'a t -> 'a t * 'a t (** [take_drop n l] returns [l1, l2] such that [l1 @ l2 = l] and @@ -135,7 +134,7 @@ val drop_while : ('a -> bool) -> 'a t -> 'a t (** @since 0.13 *) val split : int -> 'a t -> 'a t * 'a t -(** synonym to {!take_drop} +(** Synonym to {!take_drop} @deprecated since 0.13: conflict with the {!List.split} standard function *) val last : int -> 'a t -> 'a t @@ -153,7 +152,7 @@ val find_pred_exn : ('a -> bool) -> 'a t -> 'a @since 0.11 *) val find_map : ('a -> 'b option) -> 'a t -> 'b option -(** [find f l] traverses [l], applying [f] to each element. If for +(** [find_map f l] traverses [l], applying [f] to each element. If for some element [x], [f x = Some y], then [Some y] is returned. Otherwise the call returns [None] @since 0.11 *) @@ -170,7 +169,7 @@ val findi : (int -> 'a -> 'b option) -> 'a t -> 'b option @since 0.3.4 *) val find_idx : ('a -> bool) -> 'a t -> (int * 'a) option -(** [find p x] returns [Some (i,x)] where [x] is the [i]-th element of [l], +(** [find_idx p x] returns [Some (i,x)] where [x] is the [i]-th element of [l], and [p x] holds. Otherwise returns [None] *) val remove : ?eq:('a -> 'a -> bool) -> x:'a -> 'a t -> 'a t @@ -182,7 +181,7 @@ val filter_map : ('a -> 'b option) -> 'a t -> 'b t (** Map and remove elements at the same time *) val sorted_merge : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list -> 'a list -(** merges elements from both sorted list *) +(** Merges elements from both sorted list *) val sort_uniq : ?cmp:('a -> 'a -> int) -> 'a list -> 'a list (** Sort the list and remove duplicate elements *) @@ -212,20 +211,20 @@ module Idx : sig val iteri : (int -> 'a -> unit) -> 'a t -> unit val foldi : ('b -> int -> 'a -> 'b) -> 'b -> 'a t -> 'b - (** fold on list, with index *) + (** Fold on list, with index *) val get : 'a t -> int -> 'a option val get_exn : 'a t -> int -> 'a - (** get the i-th element, or + (** Get the i-th element, or @raise Not_found if the index is invalid *) val set : 'a t -> int -> 'a -> 'a t - (** set i-th element (removes the old one), or does nothing if - index too high *) + (** Set i-th element (removes the old one), or does nothing if + index is too high *) val insert : 'a t -> int -> 'a -> 'a t - (** insert at i-th position, between the two existing elements. If the + (** Insert at i-th position, between the two existing elements. If the index is too high, append at the end of the list *) val remove : 'a t -> int -> 'a t @@ -245,22 +244,22 @@ module Set : sig @since 0.11 *) val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a t -> bool - (** membership to the list. Linear time *) + (** Membership to the list. Linear time *) val subset : ?eq:('a -> 'a -> bool) -> 'a t -> 'a t -> bool - (** test for inclusion *) + (** Test for inclusion *) val uniq : ?eq:('a -> 'a -> bool) -> 'a t -> 'a t - (** list uniq: remove duplicates w.r.t the equality predicate. + (** List uniq. Remove duplicates w.r.t the equality predicate. Complexity is quadratic in the length of the list, but the order of elements is preserved. If you wish for a faster de-duplication but do not care about the order, use {!sort_uniq}*) val union : ?eq:('a -> 'a -> bool) -> 'a t -> 'a t -> 'a t - (** list union. Complexity is product of length of inputs. *) + (** List union. Complexity is product of length of inputs. *) val inter : ?eq:('a -> 'a -> bool) -> 'a t -> 'a t -> 'a t - (** list intersection. Complexity is product of length of inputs., *) + (** List intersection. Complexity is product of length of inputs. *) end (** {2 Other Constructors} *) @@ -277,10 +276,10 @@ val (--) : int -> int -> int t (** Infix alias for [range] *) val replicate : int -> 'a -> 'a t -(** replicate the given element [n] times *) +(** Replicate the given element [n] times *) val repeat : int -> 'a t -> 'a t -(** concatenate the list with itself [n] times *) +(** Concatenate the list with itself [n] times *) (** {2 Association Lists} *) @@ -341,7 +340,7 @@ module Zipper : sig val right_exn : 'a t -> 'a t (** Go to the right, or - @raise Invalid_argument if the zipper is already at rightmost position + @raise Invalid_argument if the zipper is already at rightmost pos @since 0.14 *) val modify : ('a option -> 'a option) -> 'a t -> 'a t diff --git a/src/core/CCMap.ml b/src/core/CCMap.ml index ec9c6d0e..0fdc6e9e 100644 --- a/src/core/CCMap.ml +++ b/src/core/CCMap.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -123,4 +122,3 @@ module Make(O : Map.OrderedType) = struct ) m; Format.pp_print_string fmt stop end - diff --git a/src/core/CCMap.mli b/src/core/CCMap.mli index b386ad63..51ec28fc 100644 --- a/src/core/CCMap.mli +++ b/src/core/CCMap.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCOpt.ml b/src/core/CCOpt.ml index 2d03c29a..40d87580 100644 --- a/src/core/CCOpt.ml +++ b/src/core/CCOpt.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -190,4 +189,3 @@ let pp ppx buf o = match o with let print ppx out = function | None -> Format.pp_print_string out "None" | Some x -> Format.fprintf out "@[Some %a@]" ppx x - diff --git a/src/core/CCOpt.mli b/src/core/CCOpt.mli index 3373e12b..699ea632 100644 --- a/src/core/CCOpt.mli +++ b/src/core/CCOpt.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -58,13 +57,13 @@ val flat_map : ('a -> 'b t) -> 'a t -> 'b t val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t val iter : ('a -> unit) -> 'a t -> unit -(** Iterate on 0 or 1 elements *) +(** Iterate on 0 or 1 element *) val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a -(** Fold on 0 or 1 elements *) +(** Fold on 0 or 1 element *) val filter : ('a -> bool) -> 'a t -> 'a t -(** Filter on 0 or 1 elements +(** Filter on 0 or 1 element @since 0.5 *) val get : 'a -> 'a t -> 'a @@ -138,4 +137,3 @@ val pp : 'a printer -> 'a t printer val print : 'a fmt -> 'a t fmt (** @since 0.13 *) - diff --git a/src/core/CCOrd.ml b/src/core/CCOrd.ml index e42be33e..4f2ace2a 100644 --- a/src/core/CCOrd.ml +++ b/src/core/CCOrd.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCOrd.mli b/src/core/CCOrd.mli index 45d24259..52dae3b7 100644 --- a/src/core/CCOrd.mli +++ b/src/core/CCOrd.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCPair.ml b/src/core/CCPair.ml index 21e1b06c..f377a3f1 100644 --- a/src/core/CCPair.ml +++ b/src/core/CCPair.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCPair.mli b/src/core/CCPair.mli index e2ccd3ba..905ecce0 100644 --- a/src/core/CCPair.mli +++ b/src/core/CCPair.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCPrint.ml b/src/core/CCPrint.ml index 9afcf7f9..22c24e1a 100644 --- a/src/core/CCPrint.ml +++ b/src/core/CCPrint.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. diff --git a/src/core/CCPrint.mli b/src/core/CCPrint.mli index 64eb5d24..3b88617d 100644 --- a/src/core/CCPrint.mli +++ b/src/core/CCPrint.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. @@ -91,7 +90,7 @@ val output : out_channel -> 'a t -> 'a -> unit val to_string : 'a t -> 'a -> string val sprintf : ('a, Buffer.t, unit, string) format4 -> 'a - (** print into a string *) + (** Print into a string *) val fprintf : out_channel -> ('a, Buffer.t, unit, unit) format4 -> 'a (** Print on a channel *) diff --git a/src/core/CCRandom.ml b/src/core/CCRandom.ml index 9a0f597f..cc387065 100644 --- a/src/core/CCRandom.ml +++ b/src/core/CCRandom.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -91,7 +90,7 @@ let _split i st = let split i st = try Some (_split i st) with SplitFail -> None -(* partition of an int into [len] integers. We divide-and-conquer on +(* Partition of an int into [len] integers. We divide-and-conquer on the expected length, until it reaches 1. *) let split_list i ~len st = let rec aux i ~len acc = @@ -178,4 +177,3 @@ let (<*>) f g st = f st (g st) let __default_state = Random.State.make_self_init () let run ?(st=__default_state) g = g st - diff --git a/src/core/CCRandom.mli b/src/core/CCRandom.mli index 05b05c8c..e42e1f01 100644 --- a/src/core/CCRandom.mli +++ b/src/core/CCRandom.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -74,7 +73,7 @@ val choose_return : 'a list -> 'a t @raise Invalid_argument if the list is empty *) val replicate : int -> 'a t -> 'a list t -(** [replace n g] makes a list of [n] elements which are all generated +(** [replicate n g] makes a list of [n] elements which are all generated randomly using [g] *) val list_seq : 'a t list -> 'a list t @@ -146,5 +145,3 @@ val (<*>) : ('a -> 'b) t -> 'a t -> 'b t val run : ?st:state -> 'a t -> 'a (** Using a random state (possibly the one in argument) run a generator *) - - diff --git a/src/core/CCRef.ml b/src/core/CCRef.ml index e3965765..80861110 100644 --- a/src/core/CCRef.ml +++ b/src/core/CCRef.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -54,5 +53,3 @@ let to_seq r yield = yield !r let print pp_x fmt r = pp_x fmt !r let pp pp_x buf r = pp_x buf !r - - diff --git a/src/core/CCRef.mli b/src/core/CCRef.mli index 35694e7e..6c6e8cfe 100644 --- a/src/core/CCRef.mli +++ b/src/core/CCRef.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -57,4 +56,3 @@ val to_seq : 'a t -> 'a sequence val print : 'a print -> 'a t print val pp : 'a pp -> 'a t pp - diff --git a/src/core/CCSet.ml b/src/core/CCSet.ml index 2ebe62ab..83d14a10 100644 --- a/src/core/CCSet.ml +++ b/src/core/CCSet.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -95,4 +94,3 @@ module Make(O : Map.OrderedType) = struct ) m; Format.pp_print_string fmt stop end - diff --git a/src/core/CCSet.mli b/src/core/CCSet.mli index 5ec3fe62..435feb2d 100644 --- a/src/core/CCSet.mli +++ b/src/core/CCSet.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/core/CCString.cppo.ml b/src/core/CCString.cppo.ml index bf48b58a..738a0c8b 100644 --- a/src/core/CCString.cppo.ml +++ b/src/core/CCString.cppo.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -86,7 +85,7 @@ let _is_sub ~sub i s j ~len = j+len <= String.length s && check 0 let is_sub ~sub i s j ~len = - if i+len > String.length sub then invalid_arg "String.is_sub"; + if i+len > String.length sub then invalid_arg "CCString.is_sub"; _is_sub ~sub i s j ~len (* note: inefficient *) @@ -116,7 +115,7 @@ let rfind ~sub s = with Exit -> !i -(* replace substring [s.[pos]....s.[pos+len-1]] by [by] in [s] *) +(* Replace substring [s.[pos]....s.[pos+len-1]] by [by] in [s] *) let replace_at_ ~pos ~len ~by s = let b = Buffer.create (length s + length by - len) in Buffer.add_substring b s 0 pos; @@ -125,7 +124,7 @@ let replace_at_ ~pos ~len ~by s = Buffer.contents b let replace ?(which=`All) ~sub ~by s = - if sub="" then invalid_arg "CCstring.replace"; + if sub="" then invalid_arg "CCString.replace"; match which with | `Left -> let i = find ~sub s in @@ -416,23 +415,23 @@ let exists p s = with MyExit -> true let map2 f s1 s2 = - if length s1 <> length s2 then invalid_arg "String.map2"; + if length s1 <> length s2 then invalid_arg "CCString.map2"; init (String.length s1) (fun i -> f s1.[i] s2.[i]) let iter2 f s1 s2 = - if length s1 <> length s2 then invalid_arg "String.iter2"; + if length s1 <> length s2 then invalid_arg "CCString.iter2"; for i = 0 to String.length s1 - 1 do f s1.[i] s2.[i] done let iteri2 f s1 s2 = - if length s1 <> length s2 then invalid_arg "String.iteri2"; + if length s1 <> length s2 then invalid_arg "CCString.iteri2"; for i = 0 to String.length s1 - 1 do f i s1.[i] s2.[i] done let fold2 f acc s1 s2 = - if length s1 <> length s2 then invalid_arg "String.fold2"; + if length s1 <> length s2 then invalid_arg "CCString.fold2"; let rec fold' acc s1 s2 i = if i = String.length s1 then acc else fold' (f acc s1.[i] s2.[i]) s1 s2 (i+1) diff --git a/src/core/CCString.mli b/src/core/CCString.mli index 5173e0be..ac5ab4ca 100644 --- a/src/core/CCString.mli +++ b/src/core/CCString.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -222,28 +221,28 @@ val iter : (char -> unit) -> string -> unit @since 0.12 *) val iteri : (int -> char -> unit) -> string -> unit -(** iter on chars with their index +(** Iter on chars with their index @since 0.12 *) val map : (char -> char) -> string -> string -(** map chars +(** Map chars @since 0.12 *) val mapi : (int -> char -> char) -> string -> string -(** map chars with their index +(** Map chars with their index @since 0.12 *) val flat_map : ?sep:string -> (char -> string) -> string -> string -(** map each chars to a string, then concatenates them all +(** Map each chars to a string, then concatenates them all @param sep optional separator between each generated string @since 0.12 *) val for_all : (char -> bool) -> string -> bool -(** true for all chars? +(** True for all chars? @since 0.12 *) val exists : (char -> bool) -> string -> bool -(** true for some char? +(** True for some char? @since 0.12 *) include S with type t := string @@ -251,32 +250,32 @@ include S with type t := string (** {2 Operations on 2 strings} *) val map2 : (char -> char -> char) -> string -> string -> string -(** map pairs of chars +(** Map pairs of chars @raise Invalid_argument if the strings have not the same length @since 0.12 *) val iter2: (char -> char -> unit) -> string -> string -> unit -(** iterate on pairs of chars +(** Iterate on pairs of chars @raise Invalid_argument if the strings have not the same length @since 0.12 *) val iteri2: (int -> char -> char -> unit) -> string -> string -> unit -(** iterate on pairs of chars with their index +(** Iterate on pairs of chars with their index @raise Invalid_argument if the strings have not the same length @since 0.12 *) val fold2: ('a -> char -> char -> 'a) -> 'a -> string -> string -> 'a -(** fold on pairs of chars +(** Fold on pairs of chars @raise Invalid_argument if the strings have not the same length @since 0.12 *) val for_all2 : (char -> char -> bool) -> string -> string -> bool -(** all pair of chars respect the predicate? +(** All pairs of chars respect the predicate? @raise Invalid_argument if the strings have not the same length @since 0.12 *) val exists2 : (char -> char -> bool) -> string -> string -> bool -(** exists a pair of chars? +(** Exists a pair of chars? @raise Invalid_argument if the strings have not the same length @since 0.12 *) @@ -284,7 +283,7 @@ val exists2 : (char -> char -> bool) -> string -> string -> bool module Split : sig val list_ : by:string -> string -> (string*int*int) list - (** split the given string along the given separator [by]. Should only + (** Eplit the given string along the given separator [by]. Should only be used with very small separators, otherwise use {!Containers_string.KMP}. @return a list of slices [(s,index,length)] that are @@ -318,7 +317,7 @@ module Split : sig val klist_cpy : by:string -> string -> string klist val left : by:string -> string -> (string * string) option - (** Split on the first occurrence of [by] from the left-most part of + (** Split on the first occurrence of [by] from the leftmost part of the string @since 0.12 *) diff --git a/src/core/CCVector.ml b/src/core/CCVector.ml index 088b40e6..2bb0d17a 100644 --- a/src/core/CCVector.ml +++ b/src/core/CCVector.ml @@ -36,7 +36,7 @@ type 'a ord = 'a -> 'a -> int type 'a printer = Buffer.t -> 'a -> unit type 'a formatter = Format.formatter -> 'a -> unit -(** a vector of 'a. *) +(** A vector of 'a. *) type ('a,'mut) t = { mutable size : int; mutable vec : 'a array; @@ -167,7 +167,7 @@ let push v x = let v = of_list [1;2;3] in push v 4; to_list v = [1;2;3;4] *) -(** add all elements of b to a *) +(** Add all elements of b to a *) let append a b = if _empty_array a then if _empty_array b @@ -198,15 +198,15 @@ let append a b = *) let get v i = - if i < 0 || i >= v.size then invalid_arg "Vector.get"; + if i < 0 || i >= v.size then invalid_arg "CCVector.get"; Array.unsafe_get v.vec i let set v i x = - if i < 0 || i >= v.size then invalid_arg "Vector.set"; + if i < 0 || i >= v.size then invalid_arg "CCVector.set"; Array.unsafe_set v.vec i x let remove v i = - if i < 0 || i >= v.size then invalid_arg "Vector.remove"; + if i < 0 || i >= v.size then invalid_arg "CCVector.remove"; (* if v.(i) not the last element, then put last element at index i *) if i < v.size - 1 then v.vec.(i) <- v.vec.(v.size - 1); diff --git a/src/core/CCVector.mli b/src/core/CCVector.mli index 12268b75..d4beb99d 100644 --- a/src/core/CCVector.mli +++ b/src/core/CCVector.mli @@ -31,7 +31,7 @@ type rw = [`RW] (** Mutability is [rw] (read-write) or [ro] (read-only) *) type ('a, 'mut) t -(** the type of a vector of elements of type ['a], with +(** The type of a vector of elements of type ['a], with a mutability flat ['mut] *) type 'a vector = ('a, rw) t @@ -70,7 +70,7 @@ val init : int -> (int -> 'a) -> ('a, 'mut) t (** Init the vector with the given function and size *) val clear : ('a, rw) t -> unit -(** clear the content of the vector *) +(** Clear the content of the vector *) val ensure_with : init:'a -> ('a, rw) t -> int -> unit (** Hint to the vector that it should have at least the given capacity. @@ -84,16 +84,16 @@ val ensure : ('a, rw) t -> int -> unit is not provided. *) val is_empty : ('a, _) t -> bool -(** is the vector empty? *) +(** Is the vector empty? *) val push : ('a, rw) t -> 'a -> unit -(** add an element at the end of the vector *) +(** Add an element at the end of the vector *) val append : ('a, rw) t -> ('a, _) t -> unit (** [append a b] adds all elements of b to a *) val append_array : ('a, rw) t -> 'a array -> unit -(** same as append, with an array *) +(** Same as append, with an array *) val append_seq : ('a, rw) t -> 'a sequence -> unit (** Append content of sequence *) @@ -105,7 +105,7 @@ val append_list : ('a, rw) t -> 'a list -> unit val equal : 'a equal -> ('a,_) t equal val compare : 'a ord -> ('a,_) t ord -(** Total ordering on vectors: Lexicographic comparison. *) +(** Total ordering on vectors. Lexicographic comparison. *) exception Empty (** Raised on empty stack *) @@ -114,7 +114,7 @@ val pop : ('a, rw) t -> 'a option (** Remove last element, or [None] *) val pop_exn : ('a, rw) t -> 'a -(** remove last element, or raise a Failure if empty +(** Remove last element, or raise a Failure if empty @raise Empty on an empty vector *) val top : ('a, _) t -> 'a option @@ -130,11 +130,11 @@ val copy : ('a,_) t -> ('a,'mut) t (** Shallow copy (may give an immutable or mutable vector) *) val shrink : ('a, rw) t -> int -> unit -(** shrink to the given size (remove elements above this size). +(** Shrink to the given size (remove elements above this size). Does nothing if the parameter is bigger than the current size. *) val member : ?eq:('a -> 'a -> bool) -> 'a -> ('a, _) t -> bool -(** is the element a member of the vector? *) +(** Is the element a member of the vector? *) val sort : ('a -> 'a -> int) -> ('a, _) t -> ('a, 'mut) t (** Sort the vector, returning a copy of it that is sorted @@ -144,39 +144,39 @@ val sort' : ('a -> 'a -> int) -> ('a, rw) t -> unit (** Sort the vector in place (modifying it). *) val uniq_sort : ('a -> 'a -> int) -> ('a, rw) t -> unit -(** Sort the array and remove duplicates, in place (e.e. modifying +(** Sort the array and remove duplicates, in place (e.g. modifying the vector itself) *) val iter : ('a -> unit) -> ('a,_) t -> unit -(** iterate on the vector's content *) +(** Iterate on the vector's content *) val iteri : (int -> 'a -> unit) -> ('a,_) t -> unit -(** iterate on the vector, with indexes *) +(** Iterate on the vector, with indexes *) val map : ('a -> 'b) -> ('a,_) t -> ('b, 'mut) t -(** map elements of the vector, yielding a new vector *) +(** Map elements of the vector, yielding a new vector *) val filter : ('a -> bool) -> ('a,_) t -> ('a, 'mut) t -(** filter elements from the vector. [filter p v] leaves [v] unchanged but +(** Filter elements from the vector. [filter p v] leaves [v] unchanged but returns a new vector that only contains elements of [v] satisfying [p]. *) val filter' : ('a -> bool) -> ('a, rw) t -> unit (** Filter elements in place. *) val fold : ('b -> 'a -> 'b) -> 'b -> ('a,_) t -> 'b -(** fold on elements of the vector *) +(** Fold on elements of the vector *) val exists : ('a -> bool) -> ('a,_) t -> bool -(** existential test (is there an element that satisfies the predicate?) *) +(** Existential test (is there an element that satisfies the predicate?) *) val for_all : ('a -> bool) -> ('a,_) t -> bool -(** universal test (do all the elements satisfy the predicate?) *) +(** Universal test (do all the elements satisfy the predicate?) *) val find : ('a -> bool) -> ('a,_) t -> 'a option (** Find an element that satisfies the predicate *) val find_exn : ('a -> bool) -> ('a,_) t -> 'a -(** find an element that satisfies the predicate, or +(** Find an element that satisfies the predicate, or @raise Not_found if no element does *) val find_map : ('a -> 'b option) -> ('a,_) t -> 'b option @@ -211,11 +211,11 @@ val (>|=) : ('a,_) t -> ('a -> 'b) -> ('b, 'mut) t (** Infix version of {!map} *) val get : ('a,_) t -> int -> 'a -(** access element by its index, or +(** Access element by its index, or @raise Invalid_argument if bad index *) val set : ('a, rw) t -> int -> 'a -> unit -(** modify element at given index, or +(** Modify element at given index, or @raise Invalid_argument if bad index *) val remove : ('a, rw) t -> int -> unit @@ -237,7 +237,7 @@ val rev_iter : ('a -> unit) -> ('a,_) t -> unit @since 0.14 *) val size : ('a,_) t -> int -(** number of elements in vector *) +(** Number of elements in vector *) val length : (_,_) t -> int (** Synonym for {! size} *) diff --git a/src/core/containers.ml b/src/core/containers.ml index b31539cc..62eb179d 100644 --- a/src/core/containers.ml +++ b/src/core/containers.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/data/CCBV.ml b/src/data/CCBV.ml index 0d9c6a5d..a758e5e2 100644 --- a/src/data/CCBV.ml +++ b/src/data/CCBV.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. diff --git a/src/data/CCBV.mli b/src/data/CCBV.mli index 2cc4a78e..8f0462e1 100644 --- a/src/data/CCBV.mli +++ b/src/data/CCBV.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. @@ -99,17 +98,17 @@ val union_into : into:t -> t -> unit (** [union ~into bv] sets [into] to the union of itself and [bv]. *) val inter_into : into:t -> t -> unit -(** [union ~into bv] sets [into] to the intersection of itself and [bv] *) +(** [inter ~into bv] sets [into] to the intersection of itself and [bv] *) val union : t -> t -> t (** [union bv1 bv2] returns the union of the two sets *) val inter : t -> t -> t -(** Intersection of bitvectors *) +(** [inter bv1 bv2] returns the intersection of the two sets *) val select : t -> 'a array -> 'a list (** [select arr bv] selects the elements of [arr] whose index - correspond to a true bit in [bv]. If [bv] is too short, elements of [arr] + corresponds to a true bit in [bv]. If [bv] is too short, elements of [arr] with too high an index cannot be selected and are therefore not selected. *) diff --git a/src/data/CCBitField.ml b/src/data/CCBitField.ml index 06475dd1..a7269096 100644 --- a/src/data/CCBitField.ml +++ b/src/data/CCBitField.ml @@ -51,7 +51,7 @@ module type S = sig @raise TooManyFields if there is no room *) val int3 : ?name:string -> unit -> int field - (** New field for 3-bits int (same as [int ~width:3]) + (** New field of type 3-bits int (same as [int ~width:3]) @raise Frozen if [freeze ()] was called @raise TooManyFields if there is no room *) diff --git a/src/data/CCBitField.mli b/src/data/CCBitField.mli index 3fb6c6a2..5e43f47d 100644 --- a/src/data/CCBitField.mli +++ b/src/data/CCBitField.mli @@ -85,7 +85,7 @@ module type S = sig @raise TooManyFields if there is no room *) val int3 : ?name:string -> unit -> int field - (** New field for 3-bits int (same as [int ~width:3]) + (** New field of type 3-bits int (same as [int ~width:3]) @raise Frozen if [freeze ()] was called @raise TooManyFields if there is no room *) diff --git a/src/data/CCBloom.ml b/src/data/CCBloom.ml index 31c95424..afbf3f2d 100644 --- a/src/data/CCBloom.ml +++ b/src/data/CCBloom.ml @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Bloom Filter} *) @@ -163,4 +162,3 @@ let add_seq f seq = seq (add f) let rec add_gen f g = match g() with | None -> () | Some x -> add f x; add_gen f g - diff --git a/src/data/CCBloom.mli b/src/data/CCBloom.mli index 9ec23372..db32c37c 100644 --- a/src/data/CCBloom.mli +++ b/src/data/CCBloom.mli @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Bloom Filter} @@ -46,7 +45,7 @@ val load : _ t -> float accurate {!mem} is *) val mem : 'a t -> 'a -> bool -(** [mem f x] tests whether [x] (probably) belongs in [f] *) +(** [mem f x] tests whether [x] (probably) belongs to [f] *) val add : 'a t -> 'a -> unit (** [add f x] adds [x] into [f] *) @@ -57,7 +56,7 @@ val union_mut : into:'a t -> 'a t -> unit @raise Invalid_argument if the two sets do not have the same size *) val union : 'a t -> 'a t -> 'a t -(** the sets MUST have the same set of hash functions +(** The sets MUST have the same set of hash functions @raise Invalid_argument if the two sets do not have the same size *) val inter_mut : into:'a t -> 'a t -> unit @@ -66,7 +65,7 @@ val inter_mut : into:'a t -> 'a t -> unit @raise Invalid_argument if the two sets do not have the same size *) val inter : 'a t -> 'a t -> 'a t -(** the sets MUST have the same set of hash functions +(** The sets MUST have the same set of hash functions @raise Invalid_argument if the two sets do not have the same size *) (** {2 Conversions} *) @@ -76,4 +75,3 @@ val add_list : 'a t -> 'a list -> unit val add_seq : 'a t -> 'a sequence -> unit val add_gen : 'a t -> 'a gen -> unit - diff --git a/src/data/CCCache.mli b/src/data/CCCache.mli index 33533aa1..9714a671 100644 --- a/src/data/CCCache.mli +++ b/src/data/CCCache.mli @@ -64,7 +64,7 @@ val with_cache_rec : ('a,'b) t -> (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b some [f' = fix f], such that recursive calls to [f'] are cached in [c]. It is similar to {!with_cache} but with a function that takes as first argument its own recursive version. - Examples (memoized Fibonacci function): + Example (memoized Fibonacci function): {[ let fib = with_cache_rec (lru 256) (fun fib' n -> match n with @@ -84,7 +84,7 @@ val iter : ('a,'b) t -> ('a -> 'b -> unit) -> unit (** Iterate on cached values. Should yield [size cache] pairs. *) val dummy : ('a,'b) t -(** dummy cache, never stores any value *) +(** Dummy cache, never stores any value *) val linear : ?eq:'a equal -> int -> ('a, 'b) t (** Linear cache with the given size. It stores key/value pairs in diff --git a/src/data/CCDeque.mli b/src/data/CCDeque.mli index 9abc3b34..e18e6eb7 100644 --- a/src/data/CCDeque.mli +++ b/src/data/CCDeque.mli @@ -47,7 +47,7 @@ val equal : ?eq:('a -> 'a -> bool) -> 'a t -> 'a t -> bool @since 0.13 *) val compare : ?cmp:('a -> 'a -> int) -> 'a t -> 'a t -> int -(** [equal a b] compares lexicographically [a] and [b] +(** [compare a b] compares lexicographically [a] and [b] @param cmp comparison function for elements @since 0.13 *) diff --git a/src/data/CCFQueue.ml b/src/data/CCFQueue.ml index 2464da25..a6b4d771 100644 --- a/src/data/CCFQueue.ml +++ b/src/data/CCFQueue.ml @@ -364,8 +364,8 @@ let append q1 q2 = *) (*$R - let q1 = of_seq (Sequence.of_list [1;2;3;4]) in - let q2 = of_seq (Sequence.of_list [5;6;7;8]) in + let q1 = of_seq (Sequence.of_list [1;2;3;4]) in + let q2 = of_seq (Sequence.of_list [5;6;7;8]) in let q = append q1 q2 in let l = Sequence.to_list (to_seq q) in OUnit.assert_equal ~printer:pp_ilist [1;2;3;4;5;6;7;8] l @@ -516,4 +516,3 @@ let print pp_x out d = pp_x out x ) d; Format.fprintf out "}@]" - diff --git a/src/data/CCFQueue.mli b/src/data/CCFQueue.mli index 486af5ee..5f76d5b6 100644 --- a/src/data/CCFQueue.mli +++ b/src/data/CCFQueue.mli @@ -86,7 +86,7 @@ val last : 'a t -> 'a option (** Last element of the queue *) val first_exn : 'a t -> 'a -(** Same as {!peek} but +(** Same as {!first} but @raise Empty if the queue is empty *) val last_exn : 'a t -> 'a diff --git a/src/data/CCFlatHashtbl.ml b/src/data/CCFlatHashtbl.ml index 904c482c..3393899b 100644 --- a/src/data/CCFlatHashtbl.ml +++ b/src/data/CCFlatHashtbl.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -269,4 +268,3 @@ module Make(X : HASHABLE) = struct (function Empty -> () | Key (_, v, _) -> yield v) tbl.arr end - diff --git a/src/data/CCFlatHashtbl.mli b/src/data/CCFlatHashtbl.mli index 364ad024..2571ea47 100644 --- a/src/data/CCFlatHashtbl.mli +++ b/src/data/CCFlatHashtbl.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/data/CCGraph.ml b/src/data/CCGraph.ml index 7b323a2e..9db9a9ec 100644 --- a/src/data/CCGraph.ml +++ b/src/data/CCGraph.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. diff --git a/src/data/CCGraph.mli b/src/data/CCGraph.mli index 340b312c..e59fc5ea 100644 --- a/src/data/CCGraph.mli +++ b/src/data/CCGraph.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -53,7 +52,7 @@ type 'a sequence_once = 'a sequence (** Sequence that should be used only once *) exception Sequence_once -(** raised when a sequence meant to be used once is used several times *) +(** Raised when a sequence meant to be used once is used several times *) module Seq : sig type 'a t = 'a sequence @@ -342,7 +341,7 @@ val mk_mut_tbl : ?eq:('v -> 'v -> bool) -> ?hash:('v -> int) -> int -> ('v, ('v * 'a * 'v)) mut_graph -(** make a new mutable graph from a Hashtbl. Edges are labelled with type ['a] *) +(** Make a new mutable graph from a Hashtbl. Edges are labelled with type ['a] *) (** {2 Immutable Graph} diff --git a/src/data/CCHashSet.ml b/src/data/CCHashSet.ml index 6d8520cb..df2e17eb 100644 --- a/src/data/CCHashSet.ml +++ b/src/data/CCHashSet.ml @@ -1,4 +1,4 @@ -(* This file is free softwarem part of containers. See file "license" for more details. *) +(* This file is free software, part of containers. See file "license" for more details. *) (** {1 Mutable Set} *) @@ -37,7 +37,7 @@ module type S = sig (** [mem s x] returns [true] iff [x] is in [s] *) val find_exn : t -> elt -> elt - (** [find s x] returns [y] if [x] and [y] are equal, and [mem s y]. + (** [find_exn s x] returns [y] if [x] and [y] are equal, and [mem s y]. @raise Not_found if [x] not in [s] *) val find : t -> elt -> elt option diff --git a/src/data/CCHashSet.mli b/src/data/CCHashSet.mli index 1412687a..c689c7bd 100644 --- a/src/data/CCHashSet.mli +++ b/src/data/CCHashSet.mli @@ -1,4 +1,4 @@ -(* This file is free softwarem part of containers. See file "license" for more details. *) +(* This file is free software, part of containers. See file "license" for more details. *) (** {1 Mutable Set} @@ -41,7 +41,7 @@ module type S = sig (** [mem s x] returns [true] iff [x] is in [s] *) val find_exn : t -> elt -> elt - (** [find s x] returns [y] if [x] and [y] are equal, and [mem s y]. + (** [find_exn s x] returns [y] if [x] and [y] are equal, and [mem s y]. @raise Not_found if [x] not in [s] *) val find : t -> elt -> elt option @@ -101,4 +101,3 @@ module type ELEMENT = sig end module Make(E : ELEMENT) : S with type elt = E.t - diff --git a/src/data/CCHashTrie.ml b/src/data/CCHashTrie.ml index b692d777..44e3647d 100644 --- a/src/data/CCHashTrie.ml +++ b/src/data/CCHashTrie.ml @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (*$inject @@ -642,7 +641,7 @@ module Make(Key : KEY) |> List.sort Pervasives.compare) ) *) - let rec add_gen_mut~id m g = match g() with + let rec add_gen_mut ~id m g = match g() with | None -> m | Some (k,v) -> add_gen_mut ~id (add_mut ~id k v m) g @@ -732,4 +731,3 @@ end assert_bool "check all get after remove" (Sequence.for_all (fun i -> None = M.get i m) Sequence.(501 -- 1000)); *) - diff --git a/src/data/CCHashTrie.mli b/src/data/CCHashTrie.mli index a9ad7341..9e694ba1 100644 --- a/src/data/CCHashTrie.mli +++ b/src/data/CCHashTrie.mli @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Hash Tries} diff --git a/src/data/CCHashconsedSet.ml b/src/data/CCHashconsedSet.ml index 5775316e..3b34d28d 100644 --- a/src/data/CCHashconsedSet.ml +++ b/src/data/CCHashconsedSet.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -58,7 +57,7 @@ module type S = sig (** Fast equality test [O(1)] *) val compare : t -> t -> int - (** Fast (arbitrary) comparisontest [O(1)] *) + (** Fast (arbitrary) comparison test [O(1)] *) val hash : t -> int (** Fast (arbitrary, deterministic) hash [O(1)] *) diff --git a/src/data/CCHashconsedSet.mli b/src/data/CCHashconsedSet.mli index 972a0668..5a6df518 100644 --- a/src/data/CCHashconsedSet.mli +++ b/src/data/CCHashconsedSet.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -62,7 +61,7 @@ module type S = sig (** Fast equality test [O(1)] *) val compare : t -> t -> int - (** Fast (arbitrary) comparisontest [O(1)] *) + (** Fast (arbitrary) comparison test [O(1)] *) val hash : t -> int (** Fast (arbitrary, deterministic) hash [O(1)] *) @@ -77,7 +76,7 @@ module type S = sig (** Iterate on elements, in no particular order *) val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a - (** fold on elements, in arbitrary order *) + (** Fold on elements, in arbitrary order *) val choose : t -> elt option diff --git a/src/data/CCIntMap.ml b/src/data/CCIntMap.ml index 3cf194e1..63a16c3a 100644 --- a/src/data/CCIntMap.ml +++ b/src/data/CCIntMap.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. diff --git a/src/data/CCIntMap.mli b/src/data/CCIntMap.mli index e470e7c5..d3622db9 100644 --- a/src/data/CCIntMap.mli +++ b/src/data/CCIntMap.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. diff --git a/src/data/CCMixmap.ml b/src/data/CCMixmap.ml index 152dcca8..39a10501 100644 --- a/src/data/CCMixmap.ml +++ b/src/data/CCMixmap.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -24,7 +23,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *) -(** {1 Hash Table with Heterogeneous Keys} *) +(** {1 Maps with Heterogeneous Values} *) type 'b injection = { get : (unit -> unit) -> 'b option; diff --git a/src/data/CCMixmap.mli b/src/data/CCMixmap.mli index c7adfe68..6675a877 100644 --- a/src/data/CCMixmap.mli +++ b/src/data/CCMixmap.mli @@ -31,7 +31,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. type 'a injection (** An accessor for values of type 'a in any map. Values put - in the map using an key can only be retrieved using this + in the map using a key can only be retrieved using this very same key. *) val create_inj : unit -> 'a injection diff --git a/src/data/CCMixset.ml b/src/data/CCMixset.ml index fcd5ddf6..ff7320c3 100644 --- a/src/data/CCMixset.ml +++ b/src/data/CCMixset.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. diff --git a/src/data/CCMixset.mli b/src/data/CCMixset.mli index cde9b021..cfc79d3d 100644 --- a/src/data/CCMixset.mli +++ b/src/data/CCMixset.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -73,5 +72,3 @@ val get_exn : key:'a key -> t -> 'a val cardinal : t -> int (** Number of mappings *) - - diff --git a/src/data/CCMixtbl.ml b/src/data/CCMixtbl.ml index 730f3093..0ec48c58 100644 --- a/src/data/CCMixtbl.ml +++ b/src/data/CCMixtbl.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/data/CCMixtbl.mli b/src/data/CCMixtbl.mli index 5878624e..2c6eec78 100644 --- a/src/data/CCMixtbl.mli +++ b/src/data/CCMixtbl.mli @@ -29,7 +29,7 @@ From https://github.com/mjambon/mixtbl (thanks to him). Example: {[ -let inj_int = CCMixtbl.access () ;; +let inj_int = CCMixtbl.create_inj () ;; let tbl = CCMixtbl.create 10 ;; @@ -39,7 +39,7 @@ CCMixtbl.set inj_int tbl "a" 1;; OUnit.assert_equal (Some 1) (CCMixtbl.get ~inj:inj_int tbl "a");; -let inj_string = CCMixtbl.access () ;; +let inj_string = CCMixtbl.create_inj () ;; CCMixtbl.set inj_string tbl "b" "Hello"; @@ -60,7 +60,7 @@ type 'a t type 'b injection (** An accessor for values of type 'b in any table. Values put - in the table using an key can only be retrieved using this + in the table using a key can only be retrieved using this very same key. *) val create : int -> 'a t diff --git a/src/data/CCMultiMap.ml b/src/data/CCMultiMap.ml index 83d19d24..4486a68c 100644 --- a/src/data/CCMultiMap.ml +++ b/src/data/CCMultiMap.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. diff --git a/src/data/CCMultiMap.mli b/src/data/CCMultiMap.mli index bf6e8d4b..2562310b 100644 --- a/src/data/CCMultiMap.mli +++ b/src/data/CCMultiMap.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. @@ -127,10 +126,10 @@ module type BIDIR = sig (** Remove a specific binding *) val cardinal_left : t -> int - (** number of distinct left keys *) + (** Number of distinct left keys *) val cardinal_right : t -> int - (** number of distinct right keys *) + (** Number of distinct right keys *) val remove_left : t -> left -> t (** Remove all bindings for the left key *) diff --git a/src/data/CCMultiSet.ml b/src/data/CCMultiSet.ml index 3fa4c8c1..f5c0389b 100644 --- a/src/data/CCMultiSet.ml +++ b/src/data/CCMultiSet.ml @@ -131,7 +131,7 @@ module Make(O : Set.OrderedType) = struct if n=0 then ms else M.remove x ms | n' -> if n' < 0 - then invalid_arg "CCMultiSet.udpate" + then invalid_arg "CCMultiSet.update" else M.add x n' ms let min ms = @@ -150,12 +150,12 @@ module Make(O : Set.OrderedType) = struct m1 m2 let meet m1 m2 = - M.merge - (fun _ n1 n2 -> match n1, n2 with - | None, None -> assert false - | Some n, None | None, Some n -> Some n - | Some n1, Some n2 -> Some (Pervasives.max n1 n2)) - m1 m2 + M.merge + (fun _ n1 n2 -> match n1, n2 with + | None, None -> assert false + | Some n, None | None, Some n -> Some n + | Some n1, Some n2 -> Some (Pervasives.max n1 n2)) + m1 m2 let intersection m1 m2 = M.merge diff --git a/src/data/CCMultiSet.mli b/src/data/CCMultiSet.mli index a6574d4a..dff270fb 100644 --- a/src/data/CCMultiSet.mli +++ b/src/data/CCMultiSet.mli @@ -66,6 +66,7 @@ module type S = sig (** Minimal element w.r.t the total ordering on elements *) val max : t -> elt + (** Maximal element w.r.t the total ordering on elements *) val union : t -> t -> t (** [union a b] contains as many occurrences of an element [x] diff --git a/src/data/CCPersistentArray.mli b/src/data/CCPersistentArray.mli index 0aeff3ba..acf13ce2 100644 --- a/src/data/CCPersistentArray.mli +++ b/src/data/CCPersistentArray.mli @@ -53,7 +53,7 @@ val init : int -> (int -> 'a) -> 'a t only [Sys.max_array_length / 2].*) val get : 'a t -> int -> 'a -(** [get a i] Returns the element with index [i] from the array [a]. +(** [get a i] returns the element with index [i] from the array [a]. @raise Invalid_argument "index out of bounds" if [n] is outside the range [0] to [Array.length a - 1].*) @@ -133,4 +133,3 @@ type 'a printer = Format.formatter -> 'a -> unit val print : 'a printer -> 'a t printer (** @since 0.13 *) - diff --git a/src/data/CCPersistentHashtbl.mli b/src/data/CCPersistentHashtbl.mli index cc1438a4..908b9252 100644 --- a/src/data/CCPersistentHashtbl.mli +++ b/src/data/CCPersistentHashtbl.mli @@ -151,4 +151,3 @@ end (** {2 Implementation} *) module Make(H : HashedType) : S with type key = H.t - diff --git a/src/data/CCRAL.ml b/src/data/CCRAL.ml index 25e8cf62..697e2bb5 100644 --- a/src/data/CCRAL.ml +++ b/src/data/CCRAL.ml @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Random-Access Lists} *) @@ -108,7 +107,7 @@ let front l = match l with Some (x, Cons (size', t1, Cons (size', t2, l'))) let front_exn l = match l with - | Nil -> invalid_arg "RAL.front" + | Nil -> invalid_arg "RAL.front_exn" | Cons (_, Leaf x, tl) -> x, tl | Cons (size, Node (x, t1, t2), l') -> let size' = size / 2 in @@ -574,4 +573,3 @@ let print ?(sep=", ") pp_item fmt l = pp_item fmt x ); () - diff --git a/src/data/CCRAL.mli b/src/data/CCRAL.mli index 2e1ac0b5..081645ce 100644 --- a/src/data/CCRAL.mli +++ b/src/data/CCRAL.mli @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Random-Access Lists} @@ -185,5 +184,3 @@ include module type of Infix type 'a printer = Format.formatter -> 'a -> unit val print : ?sep:string -> 'a printer -> 'a t printer - - diff --git a/src/data/CCRingBuffer.ml b/src/data/CCRingBuffer.ml index 91baf4dc..d54e85de 100644 --- a/src/data/CCRingBuffer.ml +++ b/src/data/CCRingBuffer.ml @@ -393,7 +393,7 @@ module MakeFromArray(A:Array.S) = struct let blit_into b to_buf o len = if o+len > A.length to_buf - then invalid_arg "RingBuffer.blit_into"; + then invalid_arg "CCRingBuffer.blit_into"; if b.stop >= b.start then let n = min (b.stop - b.start) len in @@ -529,7 +529,7 @@ module MakeFromArray(A:Array.S) = struct let skip b len = if len > length b then - invalid_arg ("CCRingRingBuffer.skip: " ^ string_of_int len); + invalid_arg ("CCRingBuffer.skip: " ^ string_of_int len); if b.stop >= b.start then b.start <- b.start + len else diff --git a/src/data/CCTrie.ml b/src/data/CCTrie.ml index 93b99a00..36b0ddf3 100644 --- a/src/data/CCTrie.ml +++ b/src/data/CCTrie.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -108,7 +107,7 @@ module type S = sig (** {6 Ranges} *) val above : key -> 'a t -> (key * 'a) sequence - (** All bindings whose key is bigger than (or equal to) the given key *) + (** All bindings whose key is bigger or equal to the given key *) val below : key -> 'a t -> (key * 'a) sequence (** All bindings whose key is smaller or equal to the given key *) diff --git a/src/data/CCTrie.mli b/src/data/CCTrie.mli index 3176e48a..cc0c7505 100644 --- a/src/data/CCTrie.mli +++ b/src/data/CCTrie.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -108,7 +107,7 @@ module type S = sig (** {6 Ranges} *) val above : key -> 'a t -> (key * 'a) sequence - (** All bindings whose key is bigger than (or equal to) the given key *) + (** All bindings whose key is bigger or equal to the given key *) val below : key -> 'a t -> (key * 'a) sequence (** All bindings whose key is smaller or equal to the given key *) diff --git a/src/data/CCWBTree.ml b/src/data/CCWBTree.ml index e2621f4c..d7c0b895 100644 --- a/src/data/CCWBTree.ml +++ b/src/data/CCWBTree.ml @@ -109,7 +109,7 @@ module type S = sig val extract_min : 'a t -> key * 'a * 'a t (** [extract_min m] returns [k, v, m'] where [k,v] is the pair with the - smaller key in [m], and [m'] does not contain [k]. + smallest key in [m], and [m'] does not contain [k]. @raise Not_found if the map is empty *) val extract_max : 'a t -> key * 'a * 'a t diff --git a/src/data/CCWBTree.mli b/src/data/CCWBTree.mli index 645318be..f1f89065 100644 --- a/src/data/CCWBTree.mli +++ b/src/data/CCWBTree.mli @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Weight-Balanced Tree} @@ -75,7 +74,7 @@ module type S = sig val extract_min : 'a t -> key * 'a * 'a t (** [extract_min m] returns [k, v, m'] where [k,v] is the pair with the - smaller key in [m], and [m'] does not contain [k]. + smallest key in [m], and [m'] does not contain [k]. @raise Not_found if the map is empty *) val extract_max : 'a t -> key * 'a * 'a t diff --git a/src/io/containers_io_is_deprecated.ml b/src/io/containers_io_is_deprecated.ml index 4784fafb..3cc33545 100644 --- a/src/io/containers_io_is_deprecated.ml +++ b/src/io/containers_io_is_deprecated.ml @@ -1,5 +1,5 @@ (** {!CCIO} has moved into {!Containers}, the main library. - + The reason is that it has no additional dependency and is arguably a useful completement to parts of {!Pervasives} (the channel management) diff --git a/src/iter/CCKTree.ml b/src/iter/CCKTree.ml index ab19abd4..13724389 100644 --- a/src/iter/CCKTree.ml +++ b/src/iter/CCKTree.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -346,4 +345,3 @@ module Dot = struct let g = make ~name trees in print_to_file filename g end - diff --git a/src/iter/CCKTree.mli b/src/iter/CCKTree.mli index 228b51c9..a93d42fb 100644 --- a/src/iter/CCKTree.mli +++ b/src/iter/CCKTree.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -89,7 +88,7 @@ val dfs : ?pset:'a pset -> 'a t -> [ `Enter of 'a | `Exit of 'a ] klist (** Depth-first traversal of the tree *) val bfs : ?pset:'a pset -> 'a t -> 'a klist -(** Breadth first traversal of the tree *) +(** Breadth-first traversal of the tree *) val force : 'a t -> ([ `Nil | `Node of 'a * 'b list ] as 'b) (** [force t] evaluates [t] completely and returns a regular tree @@ -171,4 +170,3 @@ module Dot : sig @param name name of the graph @since 0.6.1 *) end - diff --git a/src/sexp/CCSexp.ml b/src/sexp/CCSexp.ml index 2387356e..597dea62 100644 --- a/src/sexp/CCSexp.ml +++ b/src/sexp/CCSexp.ml @@ -168,6 +168,6 @@ module Traverse = struct | `Atom s -> _get_variant s [] l let get_exn e = match e with - | None -> failwith "Sexp.Traverse.get_exn" + | None -> failwith "CCSexp.Traverse.get_exn" | Some x -> x end diff --git a/src/sexp/CCSexpStream.ml b/src/sexp/CCSexpStream.ml index 8a56159f..4dc20ad2 100644 --- a/src/sexp/CCSexpStream.ml +++ b/src/sexp/CCSexpStream.ml @@ -163,7 +163,7 @@ module Source = struct ) let feed d s i len = - if d.stop then failwith "Sexp.Streaming.Manual.feed: reached EOI"; + if d.stop then failwith "CCSexpStream.Source.Manual.feed: reached EOI"; Buffer.add_substring d.buf s i len let reached_end d = d.stop <- true @@ -300,7 +300,7 @@ module Lexer = struct d.st <- st; _process_next d st - (* read and proces the next character *) + (* read and process the next character *) and _process_next d st = match d.src () with | Source.NC_end -> @@ -557,4 +557,3 @@ module L = struct | OhNoes msg -> `Error msg | StopNaow -> `Ok (List.rev !l) end - diff --git a/src/sexp/CCSexpStream.mli b/src/sexp/CCSexpStream.mli index 9fecedac..2c87e38d 100644 --- a/src/sexp/CCSexpStream.mli +++ b/src/sexp/CCSexpStream.mli @@ -76,7 +76,7 @@ module Source : sig type source = t (** A manual source of individual characters. When it has exhausted its - own input, it asks its caller to provide more or signal that none remains + own input, it asks its caller to provide more or signal that none remains. This is especially useful when the source of data is monadic IO *) module Manual : sig type t @@ -106,7 +106,8 @@ module Source : sig end (** {6 Streaming Lexer} -splits the input into opening parenthesis, closing ones, and atoms *) +Splits the input into opening parenthesis, closing ones, and atoms *) + module Lexer : sig type t (** A streaming lexer, that parses atomic chunks of S-expressions (atoms @@ -196,4 +197,3 @@ module L : sig val of_seq : string sequence -> t list or_error end - diff --git a/src/string/CCApp_parse.ml b/src/string/CCApp_parse.ml index e841d10b..19fe4001 100644 --- a/src/string/CCApp_parse.ml +++ b/src/string/CCApp_parse.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. diff --git a/src/string/CCApp_parse.mli b/src/string/CCApp_parse.mli index f4c9ce1a..6cc488f6 100644 --- a/src/string/CCApp_parse.mli +++ b/src/string/CCApp_parse.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -104,7 +103,7 @@ val alpha_upper : char t val alpha : char t val symbols : char t -(** symbols, such as "!-=_"... *) +(** Symbols, such as "!-=_"... *) val num : char t diff --git a/src/string/CCKMP.ml b/src/string/CCKMP.ml index bc603dc5..1b7073b5 100644 --- a/src/string/CCKMP.ml +++ b/src/string/CCKMP.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -59,7 +58,7 @@ module type S = sig (** Generator on all occurrences of the pattern *) val seq : pattern:pattern -> string -> int -> int sequence - (** iterate on matching positions *) + (** Iterate on matching positions *) (** {6 One-shot functions that compile the pattern on-the-fly} *) diff --git a/src/string/CCKMP.mli b/src/string/CCKMP.mli index 60e90dae..7d8f8d56 100644 --- a/src/string/CCKMP.mli +++ b/src/string/CCKMP.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/string/CCLevenshtein.ml b/src/string/CCLevenshtein.ml index 8fe8dee8..56f822a9 100644 --- a/src/string/CCLevenshtein.ml +++ b/src/string/CCLevenshtein.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. diff --git a/src/string/CCLevenshtein.mli b/src/string/CCLevenshtein.mli index d99ef49b..c89bd59f 100644 --- a/src/string/CCLevenshtein.mli +++ b/src/string/CCLevenshtein.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013, simon cruanes all rights reserved. diff --git a/src/string/CCParse.ml b/src/string/CCParse.ml index 680d82cf..ab1235a5 100644 --- a/src/string/CCParse.ml +++ b/src/string/CCParse.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -45,8 +44,8 @@ type input = { next : unit -> char; (** if not {!is_done}, move to next char *) pos : unit -> int; (** Current pos *) lnum : unit -> line_num; (** Line number @since 0.13 *) - cnum : unit -> col_num; (** column number @since 0.13 *) - memo : memo_; (** memoization table, if any *) + cnum : unit -> col_num; (** Column number @since 0.13 *) + memo : memo_; (** Memoization table, if any *) backtrack : int -> unit; (** Restore to previous pos *) sub : int -> int -> string; (** Extract slice from [pos] with [len] *) } diff --git a/src/string/CCParse.mli b/src/string/CCParse.mli index 29be44d8..66f16870 100644 --- a/src/string/CCParse.mli +++ b/src/string/CCParse.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -107,8 +106,8 @@ type input = { pos : unit -> int; (** Current pos *) lnum : unit -> line_num; (** Line number @since 0.13 *) - cnum : unit -> col_num; (** column number @since 0.13 *) - memo : MemoTbl.t; (** memoization table, if any *) + cnum : unit -> col_num; (** Column number @since 0.13 *) + memo : MemoTbl.t; (** Memoization table, if any *) backtrack : int -> unit; (** Restore to previous pos *) sub : int -> int -> string; (** [sub pos len] extracts slice from [pos] with [len] *) } @@ -139,7 +138,7 @@ val return : 'a -> 'a t (** Always succeeds, without consuming its input *) val pure : 'a -> 'a t -(** synonym to {!return} *) +(** Synonym to {!return} *) val (>|=) : 'a t -> ('a -> 'b) -> 'b t (** Map *) @@ -183,10 +182,10 @@ val endline : char t (** Parses '\n' *) val space : char t -(** tab or space *) +(** Tab or space *) val white : char t -(** tab or space or newline *) +(** Tab or space or newline *) val skip_chars : (char -> bool) -> unit t (** Skip 0 or more chars satisfying the predicate *) diff --git a/src/string/containers_string.ml b/src/string/containers_string.ml index 8f138db5..b2e335ac 100644 --- a/src/string/containers_string.ml +++ b/src/string/containers_string.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -28,4 +27,3 @@ module App_parse = CCApp_parse module Parse = CCParse module KMP = CCKMP module Levenshtein = CCLevenshtein - diff --git a/src/threads/CCFuture.ml b/src/threads/CCFuture.ml index 428ba00a..438b46a0 100644 --- a/src/threads/CCFuture.ml +++ b/src/threads/CCFuture.ml @@ -62,7 +62,7 @@ module Pool = struct pool.cur_size <- pool.cur_size - 1; Die - (** thread: entry point. They seek jobs in the queue *) + (** Thread: entry point. They seek jobs in the queue *) let rec serve pool = match with_lock_ pool get_next with | Die -> () @@ -115,10 +115,10 @@ module Pool = struct ) ) - (* Run the function on the argument in the given pool *) + (* run the function on the argument in the given pool *) let run pool f x = run_job pool (Job (f, x)) - (* Kill threads in the pool *) + (* kill threads in the pool *) let stop pool = with_lock_ pool (fun p -> diff --git a/src/threads/CCLock.ml b/src/threads/CCLock.ml index 3a635482..d7aaac7b 100644 --- a/src/threads/CCLock.ml +++ b/src/threads/CCLock.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. diff --git a/src/threads/CCLock.mli b/src/threads/CCLock.mli index e1c4c9d2..f1b248d4 100644 --- a/src/threads/CCLock.mli +++ b/src/threads/CCLock.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2014, simon cruanes all rights reserved. @@ -78,4 +77,3 @@ val incr : int t -> unit val decr : int t -> unit (** Atomically decrement the value @since 0.13 *) - diff --git a/src/threads/CCSemaphore.ml b/src/threads/CCSemaphore.ml index 582e04a6..22673dfd 100644 --- a/src/threads/CCSemaphore.ml +++ b/src/threads/CCSemaphore.ml @@ -1,4 +1,3 @@ - (** {1 Semaphores} *) type t = { @@ -115,5 +114,3 @@ let wait_until_at_least ~n t ~f = output "check"; assert_bool "after release 1" (CCLock.get res) *) - - diff --git a/src/threads/CCSemaphore.mli b/src/threads/CCSemaphore.mli index 819c55dc..7f8c9ad6 100644 --- a/src/threads/CCSemaphore.mli +++ b/src/threads/CCSemaphore.mli @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Semaphores} @@ -30,4 +29,3 @@ val with_acquire : n:int -> t -> f:(unit -> 'a) -> 'a val wait_until_at_least : n:int -> t -> f:(unit -> 'a) -> 'a (** [wait_until_at_least ~n s ~f] waits until [get s >= n], then calls [f ()] and returns its result. Doesn't modify the semaphore. *) - diff --git a/src/threads/CCThread.ml b/src/threads/CCThread.ml index 3e1b68ed..b43104cd 100644 --- a/src/threads/CCThread.ml +++ b/src/threads/CCThread.ml @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Threads} *) @@ -271,6 +270,3 @@ module Queue = struct let capacity q = q.capacity end - - - diff --git a/src/threads/CCThread.mli b/src/threads/CCThread.mli index 46074b30..7c38e9a7 100644 --- a/src/threads/CCThread.mli +++ b/src/threads/CCThread.mli @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) (** {1 Threads} @@ -94,4 +93,3 @@ module Queue : sig val capacity : _ t -> int (** Number of values the queue can hold *) end - diff --git a/src/top/containers_top.ml b/src/top/containers_top.ml index 4df0bdae..0e4bafb6 100644 --- a/src/top/containers_top.ml +++ b/src/top/containers_top.ml @@ -1,4 +1,3 @@ - (* This file is free software, part of containers. See file "license" for more details. *) type 'a printer = Format.formatter -> 'a -> unit @@ -33,4 +32,3 @@ let () = ; "CCKTree.print" ; "CCSexpM.print" ] - diff --git a/src/unix/CCUnix.ml b/src/unix/CCUnix.ml index 5743d636..7e38efd3 100644 --- a/src/unix/CCUnix.ml +++ b/src/unix/CCUnix.ml @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -83,7 +82,7 @@ type call_result = < stdout:string; stderr:string; status:Unix.process_status; - errcode:int; (** extracted from status *) + errcode:int; (** Extracted from status *) > let kbprintf' buf fmt k = Printf.kbprintf k buf fmt diff --git a/src/unix/CCUnix.mli b/src/unix/CCUnix.mli index 5291244c..779979e7 100644 --- a/src/unix/CCUnix.mli +++ b/src/unix/CCUnix.mli @@ -1,4 +1,3 @@ - (* copyright (c) 2013-2015, simon cruanes all rights reserved. @@ -50,7 +49,7 @@ type call_result = < stdout:string; stderr:string; status:Unix.process_status; - errcode:int; (** extracted from status *) + errcode:int; (** Extracted from status *) > val call : ?bufsize:int -> @@ -121,5 +120,3 @@ module Infix : sig end include module type of Infix - -