[Haskell-cafe] Re: Over-allocation

Gracjan Polak gracjanpolak at gmail.com
Wed Nov 21 09:03:19 EST 2007

Ketil Malde <ketil+haskell <at> ii.uib.no> writes:

> Gracjan Polak <gracjanpolak <at> gmail.com> writes:
> >     let entries = IntMap.fromList (map (\(a,b,c) -> (a,c)) (concat p))
> Gut reaction: Map is lazy in its values (but probably not the key,
> which are checked for order), so you should force the 'c' before
> inserting it in the map.  (There's probably a strict fromList or
> IntMap somewhere?) 

I tried both Map and IntMap and there was no difference in memory total usage or
usage pattern. Seems I'm already strict enough.

Values are left lazy till the point where they are forced, and that is at
write-out in my current excersise. I'd want to leave them lazy as in more
involved transformation not all of them will be needed.


More information about the Haskell-Cafe mailing list