aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/clib.mllib1
-rw-r--r--lib/int.ml15
-rw-r--r--lib/int.mli17
3 files changed, 33 insertions, 0 deletions
diff --git a/lib/clib.mllib b/lib/clib.mllib
index ca0e97bb06..f5fd721135 100644
--- a/lib/clib.mllib
+++ b/lib/clib.mllib
@@ -1,3 +1,4 @@
+Int
Pp_control
Pp
Coq_config
diff --git a/lib/int.ml b/lib/int.ml
new file mode 100644
index 0000000000..19cdfac0a6
--- /dev/null
+++ b/lib/int.ml
@@ -0,0 +1,15 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2012 *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+type t = int
+
+external equal : int -> int -> bool = "%eq"
+
+external compare : int -> int -> int = "caml_int_compare"
+
+let hash i = i land max_int
diff --git a/lib/int.mli b/lib/int.mli
new file mode 100644
index 0000000000..ae1a32dc87
--- /dev/null
+++ b/lib/int.mli
@@ -0,0 +1,17 @@
+(************************************************************************)
+(* v * The Coq Proof Assistant / The Coq Development Team *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2012 *)
+(* \VV/ **************************************************************)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(************************************************************************)
+
+(** A native integer module with usual utility functions. *)
+
+type t = int
+
+external equal : t -> t -> bool = "%eq"
+
+external compare : t -> t -> int = "caml_int_compare"
+
+val hash : t -> int