Re: [Haskell] combining IntMaps

2005-07-30 Thread Adrian Hey
On Saturday 30 Jul 2005 7:07 pm, Daan Leijen wrote: > Efficiency wise, I think one should only provide functions that ensure that > the complexity does not get worse -- if one also considers functionality > that improves on a constant factor (like traversing twice) there is no end > to the number o

Re: [Haskell] combining IntMaps

2005-07-30 Thread Daan Leijen
Adrian Hey wrote: Hello, Thanks! It's interesting the way your AVL tree library is set up -- there seems to be a much broader degree of functionality than that provided by Data.Set. But I'm trying to see, is there a significant difference in the fundamental data structure. Well Data.Set is ba

Re: [Haskell] combining IntMaps

2005-07-30 Thread Daan Leijen
Hi Chad, Scherrer, Chad wrote: the sum of the values is zero. My specification is addMaps :: IntMap Int -> IntMap Int -> IntMap Int addMaps m = IntMap.filter (/= 0) . IntMap.unionWith (+) m But I'm not really happy with this because it traverses both maps for the union, and then traverses the

Re: [Haskell] combining IntMaps

2005-07-28 Thread Adrian Hey
On Wednesday 27 Jul 2005 6:24 pm, Scherrer, Chad wrote: > Ok, it looks like I have some more reading to do. Do you know where I > can find a description of the Hedge algorithm? It's described in the Adams paper.. http://swiss.csail.mit.edu/~adams/BB/ The reason I'm sceptical about it is that (fo

RE: [Haskell] combining IntMaps

2005-07-27 Thread Scherrer, Chad
? The distinction between the two lists is still vague to me. -Chad -Original Message- From: Adrian Hey [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 27, 2005 12:04 AM To: Scherrer, Chad Cc: haskell@haskell.org Subject: Re: [Haskell] combining IntMaps Hello, On Tuesday 26 Jul 2005 7:58 pm, Sch

Re: [Haskell] combining IntMaps

2005-07-26 Thread Adrian Hey
Hello, On Tuesday 26 Jul 2005 7:58 pm, Scherrer, Chad wrote: > Thanks! It's interesting the way your AVL tree library is set up -- > there seems to be a much broader degree of functionality than that > provided by Data.Set. But I'm trying to see, is there a significant > difference in the fundamen

RE: [Haskell] combining IntMaps

2005-07-26 Thread Scherrer, Chad
: [Haskell] combining IntMaps On Wednesday 20 Jul 2005 4:05 am, Scherrer, Chad wrote: > I'm using the (IntMap Int) type to implement functions (Int -> Int), > by treating non-keys as values that map to zero. I'd like to be able > to add two of these pointwise, and delete the ke

Re: [Haskell] combining IntMaps

2005-07-20 Thread Adrian Hey
On Wednesday 20 Jul 2005 4:05 am, Scherrer, Chad wrote: > I'm using the (IntMap Int) type to implement functions (Int -> Int), by > treating non-keys as values that map to zero. I'd like to be able to add > two of these pointwise, and delete the key from the resulting map when > the sum of the valu

[Haskell] combining IntMaps

2005-07-19 Thread Scherrer, Chad
Title: combining IntMaps I'm using the (IntMap Int) type to implement functions (Int -> Int), by treating non-keys as values that map to zero. I'd like to be able to add two of these pointwise, and delete the key from the resulting map when the sum of the values is zero. My specification is