Re: [Haskell-cafe] following up on space leak

2009-07-11 Thread Uwe Hollerbach
Hi, George, thanks for the pointer, it led me to some interesting reading. Alas, the problem which it solves was already solved, and the unsolved problem didn't yield any further... At this point, I've concluded that my interpreter just simply isn't tail-recursive enough: in the Collatz test case

Re: [Haskell-cafe] following up on space leak

2009-07-07 Thread George Pollard
I believe there might be an elegant solution for this using the `Last` monoid ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] following up on space leak

2009-07-05 Thread Paul L
Previously you had lastOrNil taking m [a] as input, presumably generated by mapM. So mapM is actually building an entire list before it returns the argument for you to call lastOrNil. This is where you had unexpected memory behavior. Now you are fusing lastOrNil and mapM together, and instead of

Re: [Haskell-cafe] following up on space leak

2009-07-05 Thread Uwe Hollerbach
On 7/5/09, Paul L nine...@gmail.com wrote: Previously you had lastOrNil taking m [a] as input, presumably generated by mapM. So mapM is actually building an entire list before it returns the argument for you to call lastOrNil. This is where you had unexpected memory behavior. Now you are

Re: [Haskell-cafe] following up on space leak

2009-07-05 Thread Alexander Dunlap
On Sun, Jul 5, 2009 at 7:46 PM, Uwe Hollerbachuhollerb...@gmail.com wrote: On 7/5/09, Paul L nine...@gmail.com wrote: Previously you had lastOrNil taking m [a] as input, presumably generated by mapM. So mapM is actually building an entire list before it returns the argument for you to call

Re: [Haskell-cafe] following up on space leak

2009-07-05 Thread Uwe Hollerbach
On 7/5/09, Alexander Dunlap alexander.dun...@gmail.com wrote: On Sun, Jul 5, 2009 at 7:46 PM, Uwe Hollerbachuhollerb...@gmail.com wrote: On 7/5/09, Paul L nine...@gmail.com wrote: Previously you had lastOrNil taking m [a] as input, presumably generated by mapM. So mapM is actually building an

[Haskell-cafe] following up on space leak

2009-07-04 Thread Uwe Hollerbach
Good evening, all, following up on my question regarding space leaks, I seem to have stumbled across something very promising. I said I was using this tiny function lastOrNil to get the last value in a list, or the empty (scheme) list if the haskell list was empty. The uses of it were all of the

Re: [Haskell-cafe] following up on space leak

2009-07-04 Thread Marcin Kosiba
On Saturday 04 July 2009, Uwe Hollerbach wrote: Good evening, all, following up on my question regarding space leaks, I seem to have stumbled across something very promising. I said I was using this tiny function lastOrNil to get the last value in a list, or the empty (scheme) list if the

Re: [Haskell-cafe] following up on space leak

2009-07-04 Thread Uwe Hollerbach
On 7/4/09, Marcin Kosiba marcin.kos...@gmail.com wrote: On Saturday 04 July 2009, Uwe Hollerbach wrote: Good evening, all, following up on my question regarding space leaks, I seem to have stumbled across something very promising. I said I was using this tiny function lastOrNil to get the last