[Haskell-cafe] Re: Long running Haskell program

2009-11-12 Thread Heinrich Apfelmus
David Menendez wrote: I think replacing put s with put $! s should guarantee that the state is evaluated. If you're using get and put in many place in the code, you could try something along these lines: newtype SStateT s m a = S { unS :: StateT s m a } deriving (Monad, etc.) instance

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-12 Thread Matthew Pocock
2009/11/12 Heinrich Apfelmus apfel...@quantentunnel.de Interestingly, this is different from Control.Monad.State.Strict . The latter never forces the state itself, just the pair constructor of the (result,state) pair. Yes. This bit me the first time I came across it. I think we need a

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-12 Thread Matthew Pocock
2009/11/12 Heinrich Apfelmus apfel...@quantentunnel.de Interestingly, this is different from Control.Monad.State.Strict . The latter never forces the state itself, just the pair constructor of the (result,state) pair. Yes. This bit me the first time I came across it. I think we need a

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-12 Thread Felipe Lessa
On Thu, Nov 12, 2009 at 8:01 AM, Matthew Pocock matthew.poc...@ncl.ac.uk wrote: Yes. This bit me the first time I came across it. I think we need a Control.Monad.State.StrictOnState with strict behaviour on the state value. I notice this same underlying issue is coming up in more than one

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-12 Thread Matthew Pocock
How about: instance (Monad m) = MonadState s (SStateT s m) where get = S get put s = S (put $ using s $ strategy m) where our state monad has a strategy field? Matthew ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: Long running Haskell program

2009-11-11 Thread Andy Stewart
David Leimbach leim...@gmail.com writes: As some of you may know, I've been writing commercial Haskell code for a little bit here (about a year and a half) and I've just recently had to write some code that was going to run have to run for a really long time before being restarted,

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-11 Thread David Leimbach
On Wed, Nov 11, 2009 at 8:20 AM, Andy Stewart lazycat.mana...@gmail.comwrote: David Leimbach leim...@gmail.com writes: As some of you may know, I've been writing commercial Haskell code for a little bit here (about a year and a half) and I've just recently had to write some code that was

Re: [Haskell-cafe] Re: Long running Haskell program

2009-11-11 Thread Wei Hu
I used to be a victim of GFW, so I can feel your pain. You may try to subscribe to http://leimy9.blogspot.com/feeds/posts/default in your Google Reader. In case that fails too, I've pasted the blog post below, with no images: I've been using Haskell in a serious way for about 2 years. Been using