Skip to content
This repository
Browse code

Rename batInt.eq to .equal, will rename more

  • Loading branch information...
commit a80de2ab161ad476d3bc2608125cf104e9d2f9bc 1 parent a61acc3
Edgar Friendly thelema authored
2  src/batArray.ml
@@ -595,7 +595,7 @@ let ord_elements eq_elt a1 a2 = ord_aux eq_elt 0 a1 a2
595 595
596 596 let eq eq_elt a1 a2 =
597 597 BatOrd.bin_eq
598   - BatInt.eq (length a1) (length a2)
  598 + BatInt.equal (length a1) (length a2)
599 599 (eq_elements eq_elt) a1 a2
600 600 (*$T
601 601 eq (=) [|1;2;3|] [|1;2;3|]
4 src/batIMap.ml
@@ -274,10 +274,10 @@ let empty ~eq = {m = Core.empty; eq}
274 274 let is_empty {m} = Core.is_empty m
275 275 let add x y {m;eq} = {m=Core.add ~eq x y m; eq}
276 276
277   -(*$= add as a & ~cmp:(List.eq (Tuple3.eq Int.eq Int.eq Int.eq)) ~printer:(List.print (Tuple3.print Int.print Int.print Int.print) |> IO.to_string)
  277 +(*$= add as a & ~cmp:(List.eq (Tuple3.eq Int.equal Int.equal Int.equal)) ~printer:(List.print (Tuple3.print Int.print Int.print Int.print) |> IO.to_string)
278 278 [(0,2,0)] (empty ~eq:(=) |> a 0 0 |> a 2 0 |> a 1 0 |> enum |> List.of_enum)
279 279 *)
280   -(*$= add as a & ~cmp:(List.eq (Tuple3.eq Int.eq Int.eq String.eq)) ~printer:(List.print (Tuple3.print Int.print Int.print String.print) |> IO.to_string)
  280 +(*$= add as a & ~cmp:(List.eq (Tuple3.eq Int.equal Int.equal String.eq)) ~printer:(List.print (Tuple3.print Int.print Int.print String.print) |> IO.to_string)
281 281 [(0,2,"foo")] \
282 282 (empty ~eq:(=) |> a 0 "foo" |> a 2 "foo" |> a 1 "foo" |> enum |> List.of_enum)
283 283 *)
2  src/batISet.ml
@@ -266,7 +266,7 @@ let fold f s x0 =
266 266 g (n1 + 1) n2 (f n1 a) in
267 267 fold_range g s x0
268 268
269   -(*$= fold & ~cmp:Int.eq ~printer:string_of_int
  269 +(*$= fold & ~cmp:Int.equal ~printer:string_of_int
270 270 (fold (+) (of_list [1,3]) 0) 6
271 271 *)
272 272
27 src/batInt.mli
@@ -141,12 +141,6 @@ val to_string : int -> string
141 141 (** Return the string representation of its argument, in signed decimal. *)
142 142
143 143
144   -val compare: t -> t -> int
145   -(** The comparison function for integers, with the same specification as
146   - {!Pervasives.compare}. Along with the type [t], this function [compare]
147   - allows the module [Int] to be passed as argument to the functors
148   - {!Set.Make} and {!Map.Make}. *)
149   -
150 144 (** custom min and max for integers is much faster than using
151 145 polymorphic one in stdlib *)
152 146 val min : int -> int -> int
@@ -204,7 +198,14 @@ val xprint: 'a BatInnerIO.output -> int -> unit
204 198 val t_printer : t BatValuePrinter.t
205 199
206 200 (** {7 Compare} *)
207   -val eq : int -> int -> bool
  201 +
  202 +val compare: t -> t -> int
  203 +(** The comparison function for integers, with the same specification as
  204 + {!Pervasives.compare}. Along with the type [t], this function [compare]
  205 + allows the module [Int] to be passed as argument to the functors
  206 + {!Set.Make} and {!Map.Make}. *)
  207 +
  208 +val equal : int -> int -> bool
208 209 val ord : int -> int -> BatOrd.order
209 210
210 211 (**
@@ -342,11 +343,6 @@ module Safe_int : sig
342 343 (** Return the string representation of its argument, in signed decimal. *)
343 344
344 345
345   - val compare: t -> t -> int
346   - (** The comparison function for integers, with the same specification as
347   - {!Pervasives.compare}. Along with the type [t], this function [compare]
348   - allows the module [Int] to be passed as argument to the functors
349   - {!Set.Make} and {!Map.Make}. *)
350 346
351 347 val operations : t BatNumber.numeric
352 348
@@ -362,6 +358,11 @@ module Safe_int : sig
362 358
363 359 val print: 'a BatInnerIO.output -> t -> unit
364 360
365   - val eq : t -> t -> bool
  361 + val compare: t -> t -> int
  362 + (** The comparison function for integers, with the same specification as
  363 + {!Pervasives.compare}. Along with the type [t], this function [compare]
  364 + allows the module [Int] to be passed as argument to the functors
  365 + {!Set.Make} and {!Map.Make}. *)
  366 + val equal : t -> t -> bool
366 367 val ord : t -> t -> BatOrd.order
367 368 end
7 src/batNumber.ml
@@ -96,6 +96,9 @@ sig
96 96 val modulo : t -> t -> t
97 97 val pow : t -> t -> t
98 98 val compare : t -> t -> int
  99 + val equal : t -> t -> bool
  100 + val ord : t BatOrd.ord
  101 +
99 102 val of_int : int -> t
100 103 val to_int : t -> int
101 104 val of_float: float -> t
@@ -107,8 +110,6 @@ sig
107 110 val succ : t -> t
108 111 val pred : t -> t
109 112
110   - val eq : t -> t -> bool
111   - val ord : t BatOrd.ord
112 113 module Infix : Infix with type bat__infix_t = t
113 114 module Compare : Compare with type bat__compare_t = t
114 115 include Infix with type bat__infix_t = t
@@ -256,7 +257,7 @@ module MakeNumeric (Base : NUMERIC_BASE) : Numeric with type t = Base.t = struct
256 257
257 258 type discrete = t
258 259
259   - let eq x y = Base.compare x y = 0
  260 + let equal x y = Base.compare x y = 0
260 261 let ord x y = BatOrd.ord0 (Base.compare x y)
261 262
262 263 module Infix = MakeInfix (Base)
6 src/batNumber.mli
@@ -138,7 +138,11 @@ sig
138 138 val div : t -> t -> t
139 139 val modulo : t -> t -> t
140 140 val pow : t -> t -> t
  141 +
141 142 val compare : t -> t -> int
  143 + val equal : t -> t -> bool
  144 + val ord : t BatOrd.ord (* t -> t -> [Eq|Gt|Lt] *)
  145 +
142 146 val of_int : int -> t
143 147 val to_int : t -> int
144 148 val of_float: float -> t
@@ -153,8 +157,6 @@ sig
153 157 val succ : t -> t
154 158 val pred : t -> t
155 159
156   - val eq : t -> t -> bool
157   - val ord : t BatOrd.ord (* t -> t -> [Eq|Gt|Lt] *)
158 160
159 161 module Infix : Infix with type bat__infix_t = t
160 162 module Compare : Compare with type bat__compare_t = t
4 src/batOrd.ml
@@ -143,8 +143,8 @@ let map_comp f comp = fun a b -> comp (f a) (f b)
143 143 let map_ord f ord = fun a b -> ord (f a) (f b)
144 144
145 145 (*$T map_eq
146   - map_eq List.length Int.eq [3] [7]
147   - not (map_eq List.length Int.eq [] [8;9])
  146 + map_eq List.length Int.equal [3] [7]
  147 + not (map_eq List.length Int.equal [] [8;9])
148 148 *)
149 149 (*$T map_comp
150 150 map_comp Array.length Int.compare [|5;6;7|] [|1;2;3|] = 0

0 comments on commit a80de2a

Please sign in to comment.
Something went wrong with that request. Please try again.