diff options
author | joe <joe@jerkface.net> | 2017-08-05 23:44:07 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2017-08-05 23:44:07 -0400 |
commit | 41692ccb7ca5c291e93dc317c323479c34e854f5 (patch) | |
tree | 4731a52f648b5bb32288bc6bd2ca920acff4c41c | |
parent | 48f9c47ed7ed496ae0a1453fa107fae2f386f07f (diff) |
lookup' implemented for MinMaxPSQ.
-rw-r--r-- | src/Data/MinMaxPSQ.hs | 3 |
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 | |||
80 | take !n !q | (size q <= n) = q | 80 | take !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 | |||
84 | lookup' :: (PSQKey k, Ord p) => k -> MinMaxPSQ' k p v -> Maybe (p, v) | ||
85 | lookup' k (MinMaxPSQ q _) = PSQ.lookup k q | ||