lookupLE

lookupLE :: Key -> IntMap a -> Maybe (Key, a)
containers Data.IntMap.Strict, containers Data.IntMap.Lazy
O(log n). Find largest key smaller or equal to the given one and return the corresponding (key, value) pair. > lookupLE 2 (fromList [(3,'a'), (5,'b')]) == Nothing > lookupLE 4 (fromList [(3,'a'), (5,'b')]) == Just (3, 'a') > lookupLE 5 (fromList [(3,'a'), (5,'b')]) == Just (5, 'b')
lookupLE :: Key -> IntSet -> Maybe Key
containers Data.IntSet
O(log n). Find largest element smaller or equal to the given one. > lookupLE 2 (fromList [3, 5]) == Nothing > lookupLE 4 (fromList [3, 5]) == Just 3 > lookupLE 5 (fromList [3, 5]) == Just 5
lookupLE :: Ord a => a -> Set a -> Maybe a
containers Data.Set
O(log n). Find largest element smaller or equal to the given one. > lookupLE 2 (fromList [3, 5]) == Nothing > lookupLE 4 (fromList [3, 5]) == Just 3 > lookupLE 5 (fromList [3, 5]) == Just 5
lookupLE :: Ord k => k -> Map k v -> Maybe (k, v)
containers Data.Map.Lazy, containers Data.Map.Strict
O(log n). Find largest key smaller or equal to the given one and return the corresponding (key, value) pair. > lookupLE 2 (fromList [(3,'a'), (5,'b')]) == Nothing > lookupLE 4 (fromList [(3,'a'), (5,'b')]) == Just (3, 'a') > lookupLE 5 (fromList [(3,'a'), (5,'b')]) == Just (5, 'b')