Re: [Haskell-cafe] How to incrementally update list

2012-12-02 Thread Albert Y. C. Lai
On 12-11-30 01:16 PM, Mark Thom wrote: Is there a paper or other single resource that will help me thoroughly understand non-strictness in Haskell? See my http://www.vex.net/~trebla/haskell/lazy.xhtml ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] How to incrementally update list

2012-12-02 Thread Mark Thom
Thanks Albert, I believe that's the second time you've helped me this weekend. I'm meiji11 in #haskell. Cheers. On Sun, Dec 2, 2012 at 1:34 PM, Albert Y. C. Lai tre...@vex.net wrote: On 12-11-30 01:16 PM, Mark Thom wrote: Is there a paper or other single resource that will help me thoroughly

Re: [Haskell-cafe] How to incrementally update list

2012-12-02 Thread Mark Thom
And thanks to everyone for the links and other suggestions, of course.. On Sun, Dec 2, 2012 at 5:09 PM, Mark Thom markjordant...@gmail.com wrote: Thanks Albert, I believe that's the second time you've helped me this weekend. I'm meiji11 in #haskell. Cheers. On Sun, Dec 2, 2012 at 1:34 PM,

Re: [Haskell-cafe] How to incrementally update list

2012-12-01 Thread Branimir Maksimovic
I want to simulate some calculation that does that.For example n-body simulation.Anyway this is solved ;) Date: Fri, 30 Nov 2012 13:25:57 -0800 Subject: Re: [Haskell-cafe] How to incrementally update list From: kc1...@gmail.com To: bm...@hotmail.com CC: haskell-cafe@haskell.org Why do

Re: [Haskell-cafe] How to incrementally update list

2012-11-30 Thread Mark Thom
Haskell's laziness is tricky to understand coming from imperative languages, but once you figure out its evaluation rules, you'll begin to see the elegance. Is there a paper or other single resource that will help me thoroughly understand non-strictness in Haskell? Once my programs hit a

Re: [Haskell-cafe] How to incrementally update list

2012-11-30 Thread Kim-Ee Yeoh
On Sat, Dec 1, 2012 at 1:16 AM, Mark Thom markjordant...@gmail.com wrote: Is there a paper or other single resource that will help me thoroughly understand non-strictness in Haskell? If performance is utterly vital the best resource is Core, as in, the ability to read it. The order of

Re: [Haskell-cafe] How to incrementally update list

2012-11-30 Thread KC
Why do you want to incrementally update this list a lot of times? The question would affect the answer you get; i.e. some context (non-monadically speaking). :D On Wed, Nov 28, 2012 at 3:43 AM, Branimir Maksimovic bm...@hotmail.com wrote: Problem is following short program: list = [1,2,3,4,5]

Re: [Haskell-cafe] How to incrementally update list

2012-11-28 Thread Benjamin Edwards
TCO + strictnesses annotations should take care of your problem. On 28 Nov 2012 11:44, Branimir Maksimovic bm...@hotmail.com wrote: Problem is following short program: list = [1,2,3,4,5] advance l = map (\x - x+1) l run 0 s = s run n s = run (n-1) $ advance s main = do let s =

Re: [Haskell-cafe] How to incrementally update list

2012-11-28 Thread Clark Gaebel
Here's a version that works: *import Control.DeepSeq* list = [1,2,3,4,5] advance l = *force $* map (\x - x+1) l run 0 s = s run n s = run (n-1) $ advance s main = do let s = run 5000 list putStrLn $ show s The problem is that you build of a huge chain of updates to the

Re: [Haskell-cafe] How to incrementally update list

2012-11-28 Thread Kim-Ee Yeoh
I want to incrementally update list lot of times, but don't know how to do this. Are you using the right data structure for the job? Maybe you want an array instead? -- Kim-Ee On Wed, Nov 28, 2012 at 6:43 PM, Branimir Maksimovic bm...@hotmail.comwrote: Problem is following short program:

Re: [Haskell-cafe] How to incrementally update list

2012-11-28 Thread Branimir Maksimovic
Thank you very much! That solved it ;)I had to put explicit type signature in front of advance in order to compile From: cgae...@uwaterloo.ca Date: Wed, 28 Nov 2012 08:01:38 -0500 Subject: Re: [Haskell-cafe] How to incrementally update list To: edwards.b...@gmail.com CC: bm...@hotmail.com