From 41692ccb7ca5c291e93dc317c323479c34e854f5 Mon Sep 17 00:00:00 2001 From: joe Date: Sat, 5 Aug 2017 23:44:07 -0400 Subject: lookup' implemented for MinMaxPSQ. --- src/Data/MinMaxPSQ.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Data') 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 take !n !q | (size q <= n) = q | null q = q | otherwise = take n $ deleteMax q + +lookup' :: (PSQKey k, Ord p) => k -> MinMaxPSQ' k p v -> Maybe (p, v) +lookup' k (MinMaxPSQ q _) = PSQ.lookup k q -- cgit v1.2.3