From 5f7ad73a35857a3c8c6b30ae437695969bc37444 Mon Sep 17 00:00:00 2001 From: Justus Matthiesen Date: Mon, 6 Feb 2023 17:16:11 +0000 Subject: [PATCH] [ new ] minimal value in a SortedSet --- src/Libraries/Data/SortedSet.idr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Libraries/Data/SortedSet.idr b/src/Libraries/Data/SortedSet.idr index 99f383689..da58ed5ec 100644 --- a/src/Libraries/Data/SortedSet.idr +++ b/src/Libraries/Data/SortedSet.idr @@ -82,3 +82,7 @@ singleton k = insert k empty export toSortedMap : SortedSet k -> SortedMap k () toSortedMap (SetWrapper m) = m + +export +min : SortedSet k -> Maybe k +min (SetWrapper m) = fst <$> min m