--===============0983785754== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ryJZkp9/svQ58syV" Content-Disposition: inline --ryJZkp9/svQ58syV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Mar 24, 2010 at 11:23:05AM +0100, Heinrich Apfelmus wrote: > A quick fix would be to intersperse a function between sort and > readRecords that imposes proper evaluation order: [...] > While I expect the above to work, I hesitate to claim that it actually > does. The reason is that I don't understand your readRecords function > at a glance, unlike the processFile pipeline, it is not apparent how > it works. Since finding and fixing space leaks is easier if your code is > more obvious, I recommend to reformulate it as a function composition as > well, for instance something like this: [...] Thanks, that was enlightening! With your version of readRecords the program takes as much memory as with mine (it's still more than 10x what the C version takes, but perhaps that's the cost of using Haskell). But your version taught me a lot. Exactly the kind of feedback I needed :) Sami --ryJZkp9/svQ58syV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBCAAGBQJLqrAAAAoJEKLT589SE0a0PVAQAIa/8zocZLmrj4p72BzZJdAU tcV5Ci2CxgD9gMjSIMTB4g6VLkd4RcisOnf9UxcZGUarKFJ6NNeW/CoOKg5DNKup CVngnXOMmMLiDJWG6H7Vi70c7+oRrs+0UBSmPT7cqb1pmuQfj8tuz+dFmvF6BbVU Vq5/aInyfNASU//qB8e5/BeEDF3BnOvJxqqTkqT+UlULsuH/NjX+Rm7tLIsykhBl 7fw0/OQmtS3nxyUuUzYTyxI+eOqFfvT7ohgqLpg0MxvAL6a3TDkGhSAmtN4DKP8t stZQqudZdGXQayu9NYSG0IGo+e0ImwJlj/PIQdMCKXuqCU8txUho93mCAvkTnDKo MVlI7mp+UDc9QF1n1MoTwypFOLwgh+aVivw7eyeBh0PWBcNCzRhRikdKrHS9LIt7 6UJUfKTBYG6JqnhTtzmch3jOJps6uwq9GJfUxJkrvdt7eaXfIJF8G9q1AFBBz6G5 /GlPWAvGuDgQp3KcL0KN4bYXUXScTflonKWe2epFyRyq8FZR1j181HDRCTJDZqfq zALO4XG/7n+m5nlyqlwV1Z6lQ/uy6ByexImfqp2ROt3znPOh1goseBIFFDHRtH4d yfqioyKL0PMUw+mpt+DMI/KGQ3vrokjJeXPv7pUBRXno+41YlSdd8iKCJjQQJKIO mRbkCL8Ip/agDQbmPst+ =iqAZ -----END PGP SIGNATURE----- --ryJZkp9/svQ58syV-- --===============0983785754== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners --===============0983785754==--