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



_______________________________________________
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to