
3 Apr
2005
3 Apr
'05
7:38 a.m.
Hi all, As I tried to convert some of my code to newer libraries comming with GHC 6.4, I would like to share two things with you: I noticed that there are two functions missing: deleteList and insertList. The first one is easy with foldl: deleteList list map = foldl (flip Data.Map.delete) map list Second one is even shorter: insertList asclist map = union map (Data.Map.fromList asclist) Still I find both of them useful also execution speed seems to be of some concern here. Why generate temporary map just to join it with second in a moment? Isn't it slower? Also why Data.Map.lookup and Data.Map.findWithDefault? Why not lookupWithDefault? Besides, I really like new library :) -- Gracjan