Map/Set range function
|Reported by:||jpbernardy||Owned by:|
|Type of failure:||Test Case:||N/A|
|Related Tickets:||Differential Revisions:|
Description (last modified by jpbernardy)
Data.Map seems to lack a way to perform range queries like "fetch all elements between keys low and high". The naive implementation is easy:
range :: Ord k => k -> k -> Map.Map k v -> [(k,v)] range low high = toList . fst . split high . snd . split low
But this is not very fast for larger maps. Maybe this operation could be provided in Data.Map?