Re: [Haskell-cafe] Re: Shared thunk optimization. Looking to solidify my understanding

2010-09-25 Thread Jan-Willem Maessen
No one seems to have mentioned that this is a non-optimization in call-by-need lambda-calculus (Ariola et al.), where it follows from the standard reduction rules. Since lazy implementations of Haskell all use call-by-need evaluation in some form, I'd call this playing by the rules rather than

Re: [Haskell-cafe] Re: Shared thunk optimization. Looking to solidify my understanding

2010-09-25 Thread wren ng thornton
On 9/25/10 3:43 PM, Jan-Willem Maessen wrote: No one seems to have mentioned that this is a non-optimization in call-by-need lambda-calculus (Ariola et al.), where it follows from the standard reduction rules. Exactly. Then again, call-by-need gives a form of partial evaluation, which was

[Haskell-cafe] Re: Shared thunk optimization. Looking to solidify my understanding

2010-09-24 Thread David Sankel
On Wed, Sep 22, 2010 at 11:10 AM, David Sankel cam...@gmail.com wrote: snip My questions are: - What is the optimization that test1 is taking advantage of called? - Is said optimization required to conform to the Haskell98 standard? If so, where is it stated? - Could someone

Re: [Haskell-cafe] Re: Shared thunk optimization. Looking to solidify my understanding

2010-09-24 Thread Bernie Pope
On 25 September 2010 07:58, David Sankel cam...@gmail.com wrote: Thanks everyone for your responses. I found them very helpful. This is my current understanding, please correct me where I am wrong: When using Launchbury's Natural Semantics (LNS) as an operational model, this optimization is