Browse files

Rename batInt.eq to .equal, will rename more

  • Loading branch information...
1 parent a61acc3 commit a80de2ab161ad476d3bc2608125cf104e9d2f9bc @thelema thelema committed Jun 3, 2012
Showing with 28 additions and 24 deletions.
  1. +1 −1 src/batArray.ml
  2. +2 −2 src/batIMap.ml
  3. +1 −1 src/batISet.ml
  4. +14 −13 src/batInt.mli
  5. +4 −3 src/batNumber.ml
  6. +4 −2 src/batNumber.mli
  7. +2 −2 src/batOrd.ml
View
2 src/batArray.ml
@@ -595,7 +595,7 @@ let ord_elements eq_elt a1 a2 = ord_aux eq_elt 0 a1 a2
let eq eq_elt a1 a2 =
BatOrd.bin_eq
- BatInt.eq (length a1) (length a2)
+ BatInt.equal (length a1) (length a2)
(eq_elements eq_elt) a1 a2
(*$T
eq (=) [|1;2;3|] [|1;2;3|]
View
4 src/batIMap.ml
@@ -274,10 +274,10 @@ let empty ~eq = {m = Core.empty; eq}
let is_empty {m} = Core.is_empty m
let add x y {m;eq} = {m=Core.add ~eq x y m; eq}
-(*$= 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)
+(*$= 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)
[(0,2,0)] (empty ~eq:(=) |> a 0 0 |> a 2 0 |> a 1 0 |> enum |> List.of_enum)
*)
-(*$= 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)
+(*$= 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)
[(0,2,"foo")] \
(empty ~eq:(=) |> a 0 "foo" |> a 2 "foo" |> a 1 "foo" |> enum |> List.of_enum)
*)
View
2 src/batISet.ml
@@ -266,7 +266,7 @@ let fold f s x0 =
g (n1 + 1) n2 (f n1 a) in
fold_range g s x0
-(*$= fold & ~cmp:Int.eq ~printer:string_of_int
+(*$= fold & ~cmp:Int.equal ~printer:string_of_int
(fold (+) (of_list [1,3]) 0) 6
*)
View
27 src/batInt.mli
@@ -141,12 +141,6 @@ val to_string : int -> string
(** Return the string representation of its argument, in signed decimal. *)
-val compare: t -> t -> int
-(** The comparison function for integers, with the same specification as
- {!Pervasives.compare}. Along with the type [t], this function [compare]
- allows the module [Int] to be passed as argument to the functors
- {!Set.Make} and {!Map.Make}. *)
-
(** custom min and max for integers is much faster than using
polymorphic one in stdlib *)
val min : int -> int -> int
@@ -204,7 +198,14 @@ val xprint: 'a BatInnerIO.output -> int -> unit
val t_printer : t BatValuePrinter.t
(** {7 Compare} *)
-val eq : int -> int -> bool
+
+val compare: t -> t -> int
+(** The comparison function for integers, with the same specification as
+ {!Pervasives.compare}. Along with the type [t], this function [compare]
+ allows the module [Int] to be passed as argument to the functors
+ {!Set.Make} and {!Map.Make}. *)
+
+val equal : int -> int -> bool
val ord : int -> int -> BatOrd.order
(**
@@ -342,11 +343,6 @@ module Safe_int : sig
(** Return the string representation of its argument, in signed decimal. *)
- val compare: t -> t -> int
- (** The comparison function for integers, with the same specification as
- {!Pervasives.compare}. Along with the type [t], this function [compare]
- allows the module [Int] to be passed as argument to the functors
- {!Set.Make} and {!Map.Make}. *)
val operations : t BatNumber.numeric
@@ -362,6 +358,11 @@ module Safe_int : sig
val print: 'a BatInnerIO.output -> t -> unit
- val eq : t -> t -> bool
+ val compare: t -> t -> int
+ (** The comparison function for integers, with the same specification as
+ {!Pervasives.compare}. Along with the type [t], this function [compare]
+ allows the module [Int] to be passed as argument to the functors
+ {!Set.Make} and {!Map.Make}. *)
+ val equal : t -> t -> bool
val ord : t -> t -> BatOrd.order
end
View
7 src/batNumber.ml
@@ -96,6 +96,9 @@ sig
val modulo : t -> t -> t
val pow : t -> t -> t
val compare : t -> t -> int
+ val equal : t -> t -> bool
+ val ord : t BatOrd.ord
+
val of_int : int -> t
val to_int : t -> int
val of_float: float -> t
@@ -107,8 +110,6 @@ sig
val succ : t -> t
val pred : t -> t
- val eq : t -> t -> bool
- val ord : t BatOrd.ord
module Infix : Infix with type bat__infix_t = t
module Compare : Compare with type bat__compare_t = t
include Infix with type bat__infix_t = t
@@ -256,7 +257,7 @@ module MakeNumeric (Base : NUMERIC_BASE) : Numeric with type t = Base.t = struct
type discrete = t
- let eq x y = Base.compare x y = 0
+ let equal x y = Base.compare x y = 0
let ord x y = BatOrd.ord0 (Base.compare x y)
module Infix = MakeInfix (Base)
View
6 src/batNumber.mli
@@ -138,7 +138,11 @@ sig
val div : t -> t -> t
val modulo : t -> t -> t
val pow : t -> t -> t
+
val compare : t -> t -> int
+ val equal : t -> t -> bool
+ val ord : t BatOrd.ord (* t -> t -> [Eq|Gt|Lt] *)
+
val of_int : int -> t
val to_int : t -> int
val of_float: float -> t
@@ -153,8 +157,6 @@ sig
val succ : t -> t
val pred : t -> t
- val eq : t -> t -> bool
- val ord : t BatOrd.ord (* t -> t -> [Eq|Gt|Lt] *)
module Infix : Infix with type bat__infix_t = t
module Compare : Compare with type bat__compare_t = t
View
4 src/batOrd.ml
@@ -143,8 +143,8 @@ let map_comp f comp = fun a b -> comp (f a) (f b)
let map_ord f ord = fun a b -> ord (f a) (f b)
(*$T map_eq
- map_eq List.length Int.eq [3] [7]
- not (map_eq List.length Int.eq [] [8;9])
+ map_eq List.length Int.equal [3] [7]
+ not (map_eq List.length Int.equal [] [8;9])
*)
(*$T map_comp
map_comp Array.length Int.compare [|5;6;7|] [|1;2;3|] = 0

0 comments on commit a80de2a

Please sign in to comment.