deriving DeepSeq and deep strict fields proposals (Re[2]: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?)

2006-08-08 Thread Bulat Ziganshin
Hello Ki, Tuesday, August 8, 2006, 6:34:51 AM, you wrote: Unfortunately seq and the strict data declaration is not helpful in general. They are only helpful on base values such as Int or Bool. What they do is just making sure that it is not a thunk. That is if it was a list it would just

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-08 Thread Chris Kuklewicz
Ahn, Ki Yung wrote: Recently, I'm facing the dark side of laziness -- the memory leak because of laziness. Typical pattern that I encounter the problem is like this. My code was working fine and I was happy. I just wanted to inspect some properties of my code so I made a slight chage go the

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-08 Thread Udo Stenzel
Ahn, Ki Yung wrote: Recently, I'm facing the dark side of laziness -- the memory leak because of laziness. Are there standardized approaches for detecting and fixing these kind of problems? Not really. As Don S. already said, try heap profiling. The function that is too lazy will show up

[Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-07 Thread Ahn, Ki Yung
Recently, I'm facing the dark side of laziness -- the memory leak because of laziness. Typical pattern that I encounter the problem is like this. My code was working fine and I was happy. I just wanted to inspect some properties of my code so I made a slight chage go the code such as adding

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-07 Thread Spencer Janssen
On 8/7/06, Ahn, Ki Yung [EMAIL PROTECTED] wrote: I have posted an wiki article including one example of adding a counter to count the number of basic operations in sorting algorithm. http://www.haskell.org/haskellwiki/Physical_equality This was a rather simple situation and we figured out how

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-07 Thread Thomas Conway
Perhaps your instances will work correctly with this data declaration? Perhaps it might. But that misses an important point. The biggest impediment to developing large robust applications with Haskell is the opacity of its performance model. Haskell is fantastic in very many ways, but this

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-07 Thread Ahn, Ki Yung
On 8/7/06, Spencer Janssen [EMAIL PROTECTED] wrote: Forcing evaluation using (==) is a bit of a hack. Luckily, we have a better function to force evaluation: seq (which has type a - b - b). seq x y evaluates x to weak head normal form before returning y. Let's try another feature of Haskell

Re: [Haskell-cafe] How can we detect and fix memory leak due to lazyness?

2006-08-07 Thread Donald Bruce Stewart
kyagrd: On 8/7/06, Spencer Janssen [EMAIL PROTECTED] wrote: Forcing evaluation using (==) is a bit of a hack. Luckily, we have a better function to force evaluation: seq (which has type a - b - b). seq x y evaluates x to weak head normal form before returning y. Let's try another