aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-12-14 10:56:41 +0000
committerGravatar ppedrot <ppedrot@85f007b7-540e-0410-9357-904b9bb8a0f7>2012-12-14 10:56:41 +0000
commit9a0c61b81a2d9c0024b20a6c7ad8af01026739b0 (patch)
tree36d6f581d692180f12d52f872da4d35662aee2ab /lib
parent9330bf650ca602884c5c4c69c2fb3e94ee32838b (diff)
Moved Intset and Intmap to Int namespace.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@16067 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib')
-rw-r--r--lib/int.ml9
-rw-r--r--lib/int.mli3
-rw-r--r--lib/store.ml10
-rw-r--r--lib/util.ml3
-rw-r--r--lib/util.mli4
5 files changed, 17 insertions, 12 deletions
diff --git a/lib/int.ml b/lib/int.ml
index 19cdfac0a..86d79fd31 100644
--- a/lib/int.ml
+++ b/lib/int.ml
@@ -13,3 +13,12 @@ external equal : int -> int -> bool = "%eq"
external compare : int -> int -> int = "caml_int_compare"
let hash i = i land max_int
+
+module Self =
+struct
+ type t = int
+ let compare = compare
+end
+
+module Set = Set.Make(Self)
+module Map = Map.Make(Self)
diff --git a/lib/int.mli b/lib/int.mli
index ae1a32dc8..cde422a84 100644
--- a/lib/int.mli
+++ b/lib/int.mli
@@ -15,3 +15,6 @@ external equal : t -> t -> bool = "%eq"
external compare : t -> t -> int = "caml_int_compare"
val hash : t -> int
+
+module Set : Set.S with type elt = t
+module Map : Map.S with type key = t
diff --git a/lib/store.ml b/lib/store.ml
index ad6595ade..536e5f280 100644
--- a/lib/store.ml
+++ b/lib/store.ml
@@ -21,7 +21,7 @@ let next =
incr count;
n
-type t = Obj.t Util.Intmap.t
+type t = Obj.t Int.Map.t
module Field = struct
type 'a field = {
@@ -34,18 +34,18 @@ end
open Field
-let empty = Util.Intmap.empty
+let empty = Int.Map.empty
let field () =
let fid = next () in
let set a s =
- Util.Intmap.add fid (Obj.repr a) s
+ Int.Map.add fid (Obj.repr a) s
in
let get s =
- try Some (Obj.obj (Util.Intmap.find fid s))
+ try Some (Obj.obj (Int.Map.find fid s))
with _ -> None
in
let remove s =
- Util.Intmap.remove fid s
+ Int.Map.remove fid s
in
{ set = set ; get = get ; remove = remove }
diff --git a/lib/util.ml b/lib/util.ml
index 8d8c947c7..91497f370 100644
--- a/lib/util.ml
+++ b/lib/util.ml
@@ -119,9 +119,6 @@ let delayed_force f = f ()
type ('a,'b) union = Inl of 'a | Inr of 'b
-module Intset = Set.Make(Int)
-module Intmap = Map.Make(Int)
-
(*s interruption *)
let interrupt = ref false
diff --git a/lib/util.mli b/lib/util.mli
index 6dc6c703d..e6cb7fe9d 100644
--- a/lib/util.mli
+++ b/lib/util.mli
@@ -84,10 +84,6 @@ val delayed_force : 'a delayed -> 'a
type ('a, 'b) union = Inl of 'a | Inr of 'b
-module Intset : Set.S with type elt = int
-
-module Intmap : Map.S with type key = int
-
(** {6 ... } *)
(** Coq interruption: set the following boolean reference to interrupt Coq
(it eventually raises [Break], simulating a Ctrl-C) *)