
3 Jun
2005
3 Jun
'05
7:51 a.m.
Serge D. Mechveliani wrote:
I used to apply FiniteMap.addListToFM. Now, what is its best expression in ghc-6.4 ? Is this \ mp pairs -> Map.union (Map.fromList pairs) mp ? (the order of the arguments in Map.union is essential).
This looks fine to me. "best" is hard to meet. I'ld suggest: foldr (uncurry Map.insert) Efficiency should be tested, though. Cheers Christian P.S. Data.Map contains the following definition: fromList xs = foldlStrict ins empty xs where ins t (k,x) = insert k x t