From b0b1710ba631f3a3a3faad6e955ef703c67cb967 Mon Sep 17 00:00:00 2001 From: ppedrot Date: Thu, 8 Nov 2012 17:11:59 +0000 Subject: Monomorphized a lot of equalities over OCaml integers, thanks to the new Int module. Only the most obvious were removed, so there are a lot more in the wild. This may sound heavyweight, but it has two advantages: 1. Monomorphization is explicit, hence we do not miss particular optimizations of equality when doing it carelessly with the generic equality. 2. When we have removed all the generic equalities on integers, we will be able to write something like "let (=) = ()" to retrieve all its other uses (mostly faulty) spread throughout the code, statically. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15957 85f007b7-540e-0410-9357-904b9bb8a0f7 --- lib/util.ml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'lib/util.ml') diff --git a/lib/util.ml b/lib/util.ml index 6a0ba470a..84249e6ae 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -65,7 +65,7 @@ let strip s = let string_map f s = let l = String.length s in let r = String.create l in - for i= 0 to (l - 1) do r.[i] <- f (s.[i]) done; + for i = 0 to (l - 1) do r.[i] <- f (s.[i]) done; r let drop_simple_quotes s = @@ -118,7 +118,7 @@ let split_string_at c s = with | Not_found -> [String.sub s n (len-n)] in - if len = 0 then [] else split 0 + if Int.equal len 0 then [] else split 0 let parse_loadpath s = let l = split_string_at '/' s in @@ -207,14 +207,8 @@ let delayed_force f = f () type ('a,'b) union = Inl of 'a | Inr of 'b -module IntOrd = -struct - type t = int - external compare : int -> int -> int = "caml_int_compare" -end - -module Intset = Set.Make(IntOrd) -module Intmap = Map.Make(IntOrd) +module Intset = Set.Make(Int) +module Intmap = Map.Make(Int) (*s interruption *) -- cgit v1.2.3