summaryrefslogtreecommitdiff
path: root/src/Data/MinMaxPSQ.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2017-08-05 23:44:07 -0400
committerjoe <joe@jerkface.net>2017-08-05 23:44:07 -0400
commit41692ccb7ca5c291e93dc317c323479c34e854f5 (patch)
tree4731a52f648b5bb32288bc6bd2ca920acff4c41c /src/Data/MinMaxPSQ.hs
parent48f9c47ed7ed496ae0a1453fa107fae2f386f07f (diff)
lookup' implemented for MinMaxPSQ.
Diffstat (limited to 'src/Data/MinMaxPSQ.hs')
-rw-r--r--src/Data/MinMaxPSQ.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Data/MinMaxPSQ.hs b/src/Data/MinMaxPSQ.hs
index dc9f1882..a6329175 100644
--- a/src/Data/MinMaxPSQ.hs
+++ b/src/Data/MinMaxPSQ.hs
@@ -80,3 +80,6 @@ take :: (PSQKey k, Ord p) => Int -> MinMaxPSQ' k p v -> MinMaxPSQ' k p v
80take !n !q | (size q <= n) = q 80take !n !q | (size q <= n) = q
81 | null q = q 81 | null q = q
82 | otherwise = take n $ deleteMax q 82 | otherwise = take n $ deleteMax q
83
84lookup' :: (PSQKey k, Ord p) => k -> MinMaxPSQ' k p v -> Maybe (p, v)
85lookup' k (MinMaxPSQ q _) = PSQ.lookup k q