summaryrefslogtreecommitdiffstats
path: root/stdlib/map.mli
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/map.mli')
-rw-r--r--stdlib/map.mli20
1 files changed, 20 insertions, 0 deletions
diff --git a/stdlib/map.mli b/stdlib/map.mli
new file mode 100644
index 000000000..38e2e85e7
--- /dev/null
+++ b/stdlib/map.mli
@@ -0,0 +1,20 @@
+(* Maps over ordered types *)
+
+module type OrderedType =
+ sig
+ type t
+ val compare: t -> t -> int
+ end
+
+module type S =
+ sig
+ type key
+ type 'a t
+ val empty: 'a t
+ val add: key -> 'a -> 'a t -> 'a t
+ val find: key -> 'a t -> 'a
+ val iter: (key -> 'a -> 'b) -> 'a t -> unit
+ val fold: (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
+ end
+
+module Make(Ord: OrderedType): (S with key = Ord.t)