[ new ] popping value from a SortedSet

This commit is contained in:
Justus Matthiesen 2023-02-06 17:17:46 +00:00 committed by G. Allais
parent 692e389bb8
commit 263643defd

View File

@ -86,3 +86,9 @@ toSortedMap (SetWrapper m) = m
export
min : SortedSet k -> Maybe k
min (SetWrapper m) = fst <$> min m
export
pop : SortedSet k -> Maybe (k, SortedSet k)
pop (SetWrapper m) = do
((k, ()), m) <- pop m
pure (k, SetWrapper m)