|
Re: [GHC] #720: Map/Set range function: msg#00058lang.haskell.glasgow.bugs
#720: Map/Set range function ------------------------------+--------------------------------------------- Reporter: jpbernardy | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 6.4.1 Severity: normal | Resolution: Keywords: collections | Os: Unknown Difficulty: Unknown | Architecture: Unknown ------------------------------+--------------------------------------------- Old description: > 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? New description: 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? -- Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/720> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler_______________________________________________ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@xxxxxxxxxxx http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [GHC] #720: Map/Set range function, GHC |
|---|---|
| Next by Date: | [GHC] #721: Write Data.Trie, GHC |
| Previous by Thread: | [GHC] #720: Map/Set range function, GHC |
| Next by Thread: | [GHC] #721: Write Data.Trie, GHC |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |