export toDescList from Data.Map

Ross Paterson ross at soi.city.ac.uk
Fri Sep 26 10:36:46 EDT 2008


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)


More information about the Libraries mailing list