diff --git a/src/core/CCHashtbl.ml b/src/core/CCHashtbl.ml index 73819dd3..856dee9a 100644 --- a/src/core/CCHashtbl.ml +++ b/src/core/CCHashtbl.ml @@ -1,27 +1,6 @@ -(* -copyright (c) 2013-2014, simon cruanes -all rights reserved. -redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: +(* This file is free software, part of containers. See file "license" for more details. *) -redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. redistributions in binary -form must reproduce the above copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other materials provided with -the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -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 Extension to the standard Hashtbl} *) diff --git a/src/core/CCHashtbl.mli b/src/core/CCHashtbl.mli index 826bc636..a2ea8850 100644 --- a/src/core/CCHashtbl.mli +++ b/src/core/CCHashtbl.mli @@ -1,28 +1,5 @@ -(* -copyright (c) 2013-2014, simon cruanes -all rights reserved. - -redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. redistributions in binary -form must reproduce the above copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other materials provided with -the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -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. -*) +(* This file is free software, part of containers. See file "license" for more details. *) (** {1 Extension to the standard Hashtbl} diff --git a/src/core/CCMap.ml b/src/core/CCMap.ml index 2dc4a5df..14f7f885 100644 --- a/src/core/CCMap.ml +++ b/src/core/CCMap.ml @@ -1,27 +1,5 @@ -(* -copyright (c) 2013-2014, simon cruanes -all rights reserved. -redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. redistributions in binary -form must reproduce the above copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other materials provided with -the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -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. -*) +(* This file is free software, part of containers. See file "license" for more details. *) (** {1 Extensions of Standard Map} *) @@ -63,11 +41,13 @@ module type S = sig val to_list : 'a t -> (key * 'a) list - val pp : ?start:string -> ?stop:string -> ?arrow:string -> ?sep:string -> - key printer -> 'a printer -> 'a t printer + val pp : + ?start:string -> ?stop:string -> ?arrow:string -> ?sep:string -> + key printer -> 'a printer -> 'a t printer - val print : ?start:string -> ?stop:string -> ?arrow:string -> ?sep:string -> - key formatter -> 'a formatter -> 'a t formatter + val print : + ?start:string -> ?stop:string -> ?arrow:string -> ?sep:string -> + key formatter -> 'a formatter -> 'a t formatter end module Make(O : Map.OrderedType) = struct @@ -83,8 +63,8 @@ module Make(O : Map.OrderedType) = struct with Not_found -> f None in match x with - | None -> remove k m - | Some v' -> add k v' m + | None -> remove k m + | Some v' -> add k v' m let add_seq m s = let m = ref m in @@ -114,11 +94,11 @@ module Make(O : Map.OrderedType) = struct Buffer.add_string buf start; iter (fun k v -> - if !first then first := false else Buffer.add_string buf sep; - pp_k buf k; - Buffer.add_string buf arrow; - pp_v buf v - ) m; + if !first then first := false else Buffer.add_string buf sep; + pp_k buf k; + Buffer.add_string buf arrow; + pp_v buf v) + m; Buffer.add_string buf stop let print ?(start="[") ?(stop="]") ?(arrow="->") ?(sep=", ") pp_k pp_v fmt m = @@ -126,13 +106,14 @@ module Make(O : Map.OrderedType) = struct let first = ref true in iter (fun k v -> - if !first then first := false else ( - Format.pp_print_string fmt sep; - Format.pp_print_cut fmt () - ); - pp_k fmt k; - Format.pp_print_string fmt arrow; - pp_v fmt v; - ) m; + if !first then first := false + else ( + Format.pp_print_string fmt sep; + Format.pp_print_cut fmt () + ); + pp_k fmt k; + Format.pp_print_string fmt arrow; + pp_v fmt v) + m; Format.pp_print_string fmt stop end diff --git a/src/core/CCMap.mli b/src/core/CCMap.mli index 524e56d2..436a4d41 100644 --- a/src/core/CCMap.mli +++ b/src/core/CCMap.mli @@ -1,32 +1,10 @@ -(* -copyright (c) 2013-2014, simon cruanes -all rights reserved. -redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. redistributions in binary -form must reproduce the above copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other materials provided with -the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -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. -*) +(* This file is free software, part of containers. See file "license" for more details. *) (** {1 Extensions of Standard Map} -Provide useful functions and iterators on [Map.S] -@since 0.5 *) + Provide useful functions and iterators on [Map.S] + @since 0.5 *) type 'a sequence = ('a -> unit) -> unit type 'a printer = Buffer.t -> 'a -> unit @@ -66,13 +44,15 @@ module type S = sig val to_list : 'a t -> (key * 'a) list - val pp : ?start:string -> ?stop:string -> ?arrow:string -> ?sep:string -> - key printer -> 'a printer -> 'a t printer + val pp : + ?start:string -> ?stop:string -> ?arrow:string -> ?sep:string -> + key printer -> 'a printer -> 'a t printer - val print : ?start:string -> ?stop:string -> ?arrow:string -> ?sep:string -> - key formatter -> 'a formatter -> 'a t formatter + val print : + ?start:string -> ?stop:string -> ?arrow:string -> ?sep:string -> + key formatter -> 'a formatter -> 'a t formatter end module Make(O : Map.OrderedType) : S with type 'a t = 'a Map.Make(O).t - and type key = O.t + and type key = O.t diff --git a/src/core/CCSet.ml b/src/core/CCSet.ml index 83d14a10..f11d1981 100644 --- a/src/core/CCSet.ml +++ b/src/core/CCSet.ml @@ -1,27 +1,5 @@ -(* -copyright (c) 2013-2014, simon cruanes -all rights reserved. -redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. redistributions in binary -form must reproduce the above copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other materials provided with -the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -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. -*) +(* This file is free software, part of containers. See file "license" for more details. *) (** {1 Wrapper around Set} *) @@ -46,11 +24,13 @@ module type S = sig val to_list : t -> elt list - val pp : ?start:string -> ?stop:string -> ?sep:string -> - elt printer -> t printer + val pp : + ?start:string -> ?stop:string -> ?sep:string -> + elt printer -> t printer - val print : ?start:string -> ?stop:string -> ?sep:string -> - elt formatter -> t formatter + val print : + ?start:string -> ?stop:string -> ?sep:string -> + elt formatter -> t formatter end module Make(O : Map.OrderedType) = struct @@ -76,9 +56,9 @@ module Make(O : Map.OrderedType) = struct Buffer.add_string buf start; iter (fun x -> - if !first then first := false else Buffer.add_string buf sep; - pp_x buf x; - ) m; + if !first then first := false else Buffer.add_string buf sep; + pp_x buf x) + m; Buffer.add_string buf stop let print ?(start="[") ?(stop="]") ?(sep=", ") pp_x fmt m = @@ -86,11 +66,12 @@ module Make(O : Map.OrderedType) = struct let first = ref true in iter (fun x -> - if !first then first := false else ( - Format.pp_print_string fmt sep; - Format.pp_print_cut fmt () - ); - pp_x fmt x; - ) m; + if !first then first := false + else ( + Format.pp_print_string fmt sep; + Format.pp_print_cut fmt () + ); + pp_x fmt x) + m; Format.pp_print_string fmt stop end diff --git a/src/core/CCSet.mli b/src/core/CCSet.mli index 435feb2d..1a8fd4ba 100644 --- a/src/core/CCSet.mli +++ b/src/core/CCSet.mli @@ -1,31 +1,9 @@ -(* -copyright (c) 2013-2014, simon cruanes -all rights reserved. -redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -redistributions of source code must retain the above copyright notice, this -list of conditions and the following disclaimer. redistributions in binary -form must reproduce the above copyright notice, this list of conditions and the -following disclaimer in the documentation and/or other materials provided with -the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -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. -*) +(* This file is free software, part of containers. See file "license" for more details. *) (** {1 Wrapper around Set} -@since 0.9 *) + @since 0.9 *) type 'a sequence = ('a -> unit) -> unit type 'a printer = Buffer.t -> 'a -> unit @@ -48,13 +26,15 @@ module type S = sig val to_list : t -> elt list - val pp : ?start:string -> ?stop:string -> ?sep:string -> - elt printer -> t printer + val pp : + ?start:string -> ?stop:string -> ?sep:string -> + elt printer -> t printer - val print : ?start:string -> ?stop:string -> ?sep:string -> - elt formatter -> t formatter + val print : + ?start:string -> ?stop:string -> ?sep:string -> + elt formatter -> t formatter end module Make(O : Set.OrderedType) : S with type t = Set.Make(O).t - and type elt = O.t + and type elt = O.t