
23 Feb
2005
23 Feb
'05
6:31 a.m.
Ross Paterson wrote:
import Data.List (foldl')
addListToFM :: (Ord k) => FiniteMap k a -> [(k,a)] -> FiniteMap k a addListToFM m kvs = foldl' add m kvs where add m' (k,v) = insert k v m'
Okay, using the strict foldl' the situation changes: Now
insertList_foldl is faster for n>m and slower for n