
On Sun, Sep 21, 2014 at 02:12:04PM -0600, Dimitri DeFigueiredo wrote:
Thanks!
I don't quite understand the last sentence, though. So, it is a leak just because it needs to evaluate an element that may not be required? I thought a space leak implied we would be changing the "Big O" asymptotic order of space usage. How would the extra evaluation would change that?
Think of a network socket as the source of your list, and the first character is all you need. If you need to evaluate the second character to get the first, you could be stuck on the network socket for some time waiting for the second one to come. And I think the reason it would break some "Big O"s is that most complexity analysis in Haskell are amortized bounds and it uses the fact that Haskell is lazy and won't evaluate something until we actually need it. -- Phil Xiaojun Hu