S. Alexander Jacobson writes: > After actually running the correct test, I am > still getting semi-ridiculous space behavior > (6k/pair)! > > import qualified Map > zipped =zip [1..] [1..100000]::[(Int,Int)] > untup f (x,y) = f x y > produce = foldr (untup Map.insert) Map.empty zipped > fm = length $ Map.keys produce > main = print $ fm
Two questions I'm currently too lazy to investigate myself: Does having 'zipped' at the top level mean that the program is keeping the entire 100,000-element list in memory? Also, would performance improve if you used Map.fromList? How about Map.fromAscList? -- David Menendez <[EMAIL PROTECTED]> | "In this house, we obey the laws <http://www.eyrie.org/~zednenem> | of thermodynamics!" _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe