From 2d64afc25c5d30bf61ff42e2a79477a3cb71be9e Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Mon, 26 Apr 2021 13:31:12 -0700 Subject: [PATCH] [sledge] Add Map.max_binding Reviewed By: ngorogiannis Differential Revision: D27996950 fbshipit-source-id: b7a26c79d --- sledge/nonstdlib/NSMap.ml | 1 + sledge/nonstdlib/NSMap_intf.ml | 1 + 2 files changed, 2 insertions(+) diff --git a/sledge/nonstdlib/NSMap.ml b/sledge/nonstdlib/NSMap.ml index a716c511a..1dd3f9014 100644 --- a/sledge/nonstdlib/NSMap.ml +++ b/sledge/nonstdlib/NSMap.ml @@ -109,6 +109,7 @@ struct let choose = M.choose_opt let choose_exn = M.choose let min_binding = M.min_binding_opt + let max_binding = M.max_binding_opt let mem k m = M.mem k m let find_exn k m = M.find k m let find k m = M.find_opt k m diff --git a/sledge/nonstdlib/NSMap_intf.ml b/sledge/nonstdlib/NSMap_intf.ml index 99addcfaa..02b594ebe 100644 --- a/sledge/nonstdlib/NSMap_intf.ml +++ b/sledge/nonstdlib/NSMap_intf.ml @@ -80,6 +80,7 @@ module type S = sig equivalent maps. [O(1)]. *) val min_binding : 'a t -> (key * 'a) option + val max_binding : 'a t -> (key * 'a) option val mem : key -> 'a t -> bool val find : key -> 'a t -> 'a option val find_exn : key -> 'a t -> 'a