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

2010-09-22 Thread David Sankel
The following code (full code available here[1], example taken from comments here[2]), const' = \a _ - a test1 c = let a = const' (nthPrime 10) in (a c, a c) test2 c = let a = \_ - (nthPrime 10) in (a c, a c) in a ghci session (with :set +s): *Primes test1 1

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

2010-09-22 Thread Holger Siegel
Am 22.09.2010 um 17:10 schrieb David Sankel: The following code (full code available here[1], example taken from comments here[2]), const' = \a _ - a test1 c = let a = const' (nthPrime 10) in (a c, a c) test2 c = let a = \_ - (nthPrime 10) in (a c, a c)

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

2010-09-22 Thread Daniel Fischer
On Wednesday 22 September 2010 17:10:06, David Sankel wrote: The following code (full code available here[1], example taken from comments here[2]), const' = \a _ - a test1 c = let a = const' (nthPrime 10) in (a c, a c) test2 c = let a = \_ - (nthPrime 10) in

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

2010-09-22 Thread wren ng thornton
On 9/22/10 11:48 AM, Daniel Fischer wrote: On Wednesday 22 September 2010 17:10:06, David Sankel wrote: The following code (full code available here[1], example taken from comments here[2]), const' = \a _ - a test1 c = let a = const' (nthPrime 10) in (a c, a c) test2 c = let