
26 Sep
2008
26 Sep
'08
2:36 p.m.
On Fri, Sep 26, 2008 at 04:12:17PM +0200, Benedikt Huber wrote:
I think that having a function
treeView :: Map k v -> T (k,v)
s.t. T is an instance of Foldable, supports efficient left and right folds, and additional operations like subrange queries (all pairs (k,v) s.t. l <= k <= u) would be useful. I'd like to have all functions from Data.Foldable available for folds with key, e.g fold[lr]MWithKey.
Map has split and splitLookup for subrange queries, and you could get the folds with mapWithKey (,) :: Map k v -> Map k (k,v)