cvs commit: fptools/libraries/base package.conf.in
fptools/libraries/base/Data IntMap.hs IntSet.hs Map.hs FiniteMap.hs Set.hs
Ketil Malde
ketil+haskell at ii.uib.no
Mon Jan 17 02:38:12 EST 2005
Sven Panne <Sven.Panne at aedion.de> writes:
> I must admit that I didn't follow the data structure discussion in every
> detail, but I find something confusing: In Data.FiniteMap.addListToFM_C,
> the combining function gets the old value as the 1st argument and the new
> value as the 2nd one. In Data.Map.insertWithKey (and friends), this seems
> to be the other way round, which is undocumented and *very* confusing when
> trying to port things from FiniteMap to Map. Is there a deep reason for this?
Hmmm...I have perhaps a rather shallow reason. When using a FiniteMap
to collect lists of values, I think it will be more efficient to use
(flip (++)), prepending instead of appending each new element.
(It's a while since I looked at this, so it may not be exactly correct)
-kzm
--
If I haven't seen further, it is by standing in the footprints of giants
More information about the Libraries
mailing list