
David Bakin
I have been puzzling over this for nearly a full day (getting this reduced version from my own code which wasn't working).
and Alastair Reid
Executive summary: David's program has an incredibly subtle space leak in it (or I'm being incredibly dumb).
I don't think you were being dumb. The space leak was easy enough to
understand once explained, but I don't think it was obvious -- at any
rate it was not obvious to me.
I take this as another data point showing how lazy evaluation can cause
space leaks that are difficult to debug. If experts like Alastair Reid
have trouble understanding the operational behaviour of simplified
examples like this one, how are ordinary programmers to cope with
complicated programs? Is lazy functional programming too difficult for
ordinary mortals?
--
Fergus Henderson