From 0e6986c2f219c2436df73053e24838efdc2784c9 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Tue, 19 Jun 2018 14:05:19 +0100 Subject: [PATCH] Add Univ_map.singleton Signed-off-by: Jeremie Dimino --- src/stdune/univ_map.ml | 1 + src/stdune/univ_map.mli | 1 + 2 files changed, 2 insertions(+) diff --git a/src/stdune/univ_map.ml b/src/stdune/univ_map.ml index fcb2fb64..9bdb0f20 100644 --- a/src/stdune/univ_map.ml +++ b/src/stdune/univ_map.ml @@ -71,3 +71,4 @@ let find_exn t key = let eq = Key.eq key' key in Eq.cast eq v +let singleton key v = Int.Map.singleton (Key.id key) (Binding.T (key, v)) diff --git a/src/stdune/univ_map.mli b/src/stdune/univ_map.mli index 5c9b76eb..6cea4955 100644 --- a/src/stdune/univ_map.mli +++ b/src/stdune/univ_map.mli @@ -17,3 +17,4 @@ val add : t -> 'a Key.t -> 'a -> t val remove : t -> 'a Key.t -> t val find : t -> 'a Key.t -> 'a option val find_exn : t -> 'a Key.t -> 'a +val singleton : 'a Key.t -> 'a -> t