Is it possible/reasonable that Data.FiniteMap takes around 1k per element?

I just profiled this code:

   import Data.FiniteMap

   zipped =zip [1..] [1..50000]
   addFMItem (index,item) fm  = (addToFM $! fm) item index
   produce = foldr addFMItem emptyFM zipped
   fm = take 1 $ keysFM produce
   main = print $ fm

And it apparently consumes more than 45MB of heap and won't run unless I give it at least 3M of stack space.

I assume I doing something wrong here, but have no idea what it is.

-Alex-

______________________________________________________________
S. Alexander Jacobson tel:917-770-6565 http://alexjacobson.com
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to