diff --git a/src/data/CCWBTree.ml b/src/data/CCWBTree.ml index fe4cd5f5..8b395062 100644 --- a/src/data/CCWBTree.ml +++ b/src/data/CCWBTree.ml @@ -25,6 +25,8 @@ module type S = sig val empty : 'a t + val is_empty : _ t -> bool + val mem : key -> _ t -> bool val get : key -> 'a t -> 'a option @@ -97,6 +99,10 @@ module MakeFull(K : KEY) : S with type key = K.t = struct let empty = E + let is_empty = function + | E -> true + | N _ -> false + let rec get_exn k m = match m with | E -> raise Not_found | N (k', v, l, r, _) -> diff --git a/src/data/CCWBTree.mli b/src/data/CCWBTree.mli index 87eb975e..f74c27b0 100644 --- a/src/data/CCWBTree.mli +++ b/src/data/CCWBTree.mli @@ -30,6 +30,8 @@ module type S = sig val empty : 'a t + val is_empty : _ t -> bool + val mem : key -> _ t -> bool val get : key -> 'a t -> 'a option