[Haskell-cafe] Re: Using Collections: ElemsView and KeysView

2007-08-22 Thread Benjamin Franksen
Jean-Philippe Bernardy wrote: > foldr on ElemsView is defined as such: > >> foldr f i (ElemsView c) = foldr (f . snd) i c > > so, for example: > >> getElementList = toList . ElemViews Ok, thanks, this helps. I had forgot to look at the instances. > When I designed this code (some years ago),

[Haskell-cafe] Re: Using Collections: ElemsView and KeysView

2007-08-20 Thread Jean-Philippe Bernardy
foldr on ElemsView is defined as such: > foldr f i (ElemsView c) = foldr (f . snd) i c so, for example: > getElementList = toList . ElemViews When I designed this code (some years ago), I didn't like the "fold" of Map to have the type: > fold :: (a -> b -> b) -> b -> Map k a -> b This just