Re: [Haskell-cafe] Data.Map.fromListWith

2008-12-07 Thread Holger Siegel
On Saturday 06 December 2008 22:07:51 Paul Johnson wrote: So we could have fromListWithZero :: Ord k = (a - b - b) - b - [(k, a)] - Map k b fromListWithZero combiner zero pairs = ... The first time a key is seen the combining function is called with zero as its second argument. E.g.

[Haskell-cafe] Data.Map.fromListWith

2008-12-06 Thread Paul Johnson
I've just been looking at the Data.Map function fromListWith. According to the docs, it has the type: * fromListWith* :: Ord http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Ord.html#t%3AOrd k = (a - a - a) - [(k, a)] - Map

Re: [Haskell-cafe] Data.Map.fromListWith

2008-12-06 Thread Alexander Dunlap
On Sat, Dec 6, 2008 at 12:22 PM, Paul Johnson [EMAIL PROTECTED] wrote: I've just been looking at the Data.Map function fromListWith. According to the docs, it has the type: * fromListWith* :: Ord http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Ord.html#t%3AOrd k = (a - a -

Re: [Haskell-cafe] Data.Map.fromListWith

2008-12-06 Thread Paul Johnson
Alexander Dunlap wrote: On Sat, Dec 6, 2008 at 12:22 PM, Paul Johnson [EMAIL PROTECTED] wrote: I've just been looking at the Data.Map function fromListWith. According to the docs, it has the type: * fromListWith* :: Ord