Confusing change causing space leak

24 Apr
2009
24 Apr
'09
12:51 p.m.
Hi all, I discussed this with a few people in #haskell-in-depth, and we thought I should send this to the list. The following paste shows the only changes required to remove a space leak: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4185#a4185. Summary: if I reduce a tuple-from-IO to whnf in the "allocate" function passed to "bracket", no leak. For example, this also doesn't leak: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=4185#a4189 That paste page also contains the code for "externalSort". The "externalSort" function used in the example corresponds to the "sort" function provided by the Algorithms.ExternalSort module. Can anyone explain why the leak happens at all, or why it goes away? Denis
5872
Age (days ago)
5872
Last active (days ago)
0 comments
1 participants
participants (1)
-
Denis Bueno