aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/cMap.mli
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-02-03 16:20:46 +0100
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2016-02-03 16:25:23 +0100
commite9675e068f9e0e92bab05c030fb4722b146123b8 (patch)
tree5912374d4085bb410f5ed712328b39e965d0a868 /lib/cMap.mli
parent292e205138ca11c3dce37d48cb34ef4172f6fa06 (diff)
Adding a "get" primitive to map signature.
It is similar to find but raises an assertion failure instead of a Not_found when the element is not encountered. Using it will give stronger invariants.
Diffstat (limited to 'lib/cMap.mli')
-rw-r--r--lib/cMap.mli3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/cMap.mli b/lib/cMap.mli
index 464dc503b..3ef7fa2c8 100644
--- a/lib/cMap.mli
+++ b/lib/cMap.mli
@@ -31,6 +31,9 @@ sig
module Set : CSig.SetS with type elt = key
(** Sets used by the domain function *)
+ val get : key -> 'a t -> 'a
+ (** Same as {!find} but fails an assertion instead of raising [Not_found] *)
+
val update : key -> 'a -> 'a t -> 'a t
(** Same as [add], but expects the key to be present, and thus faster.
@raise Not_found when the key is unbound in the map. *)