[Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Nils Schweinsberg
Hi, I have been trying to use the State monad for concurrent applications and came up with a little library.[1] My MState uses an IORef to maintain the state between different threads. The library also offers a simple way to fork off new threads using its own forkM function. This function

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Jason Dagit
On Fri, Jul 2, 2010 at 9:21 AM, Nils Schweinsberg m...@n-sch.de wrote: Hi, I have been trying to use the State monad for concurrent applications and came up with a little library.[1] My MState uses an IORef to maintain the state between different threads. The library also offers a simple way

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Nils Schweinsberg
On 02.07.2010 20:05, Jason Dagit wrote: In other words, don't be shy! Ok, thanks for the reply! :) However, a question about haddock: evalMState :: Forkable m = MState t m a -- ^ Action to evaluate - t -- ^ Initial state value

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Daniel Fischer
On Friday 02 July 2010 22:32:37, Nils Schweinsberg wrote: On 02.07.2010 20:05, Jason Dagit wrote: In other words, don't be shy! Ok, thanks for the reply! :) However, a question about haddock: evalMState :: Forkable m = MState t m a -- ^ Action to evaluate

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Nils Schweinsberg
And here wo go. MState on hackage: http://hackage.haskell.org/package/mstate My first hackage library. :) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Ivan Lazar Miljenovic
Daniel Fischer daniel.is.fisc...@web.de writes: On Friday 02 July 2010 22:32:37, Nils Schweinsberg wrote: On 02.07.2010 20:05, Jason Dagit wrote: In other words, don't be shy! Ok, thanks for the reply! :) However, a question about haddock: evalMState :: Forkable m =

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Daniel Fischer
On Saturday 03 July 2010 00:52:00, Ivan Lazar Miljenovic wrote: It's been fixed in the 2.7 release apparently (I haven't upgraded, so I haven't checked that myself). Speaking of which, haddock-2.7.* came with 6.12.1, I believe, but from 6.12.2 on, haddock's version number was back down to

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Ivan Lazar Miljenovic
Daniel Fischer daniel.is.fisc...@web.de writes: On Saturday 03 July 2010 00:52:00, Ivan Lazar Miljenovic wrote: It's been fixed in the 2.7 release apparently (I haven't upgraded, so I haven't checked that myself). Speaking of which, haddock-2.7.* came with 6.12.1, I believe, but from

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Daniel Fischer
On Saturday 03 July 2010 01:36:11, Ivan Lazar Miljenovic wrote: No, 2.7 came out after 6.12.1 was released. Yes, right. I had installed 2.7 on its own (to see whether a bug displaying infix data constructors was fixed there) and misremembered. Still odd that GHC ships with 2.6 long after 2.7

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Ivan Lazar Miljenovic
Daniel Fischer daniel.is.fisc...@web.de writes: On Saturday 03 July 2010 01:36:11, Ivan Lazar Miljenovic wrote: No, 2.7 came out after 6.12.1 was released. Yes, right. I had installed 2.7 on its own (to see whether a bug displaying infix data constructors was fixed there) and

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Matthew Gruen
On Fri, Jul 2, 2010 at 4:59 PM, Nils Schweinsberg m...@n-sch.de wrote: And here wo go. MState on hackage: http://hackage.haskell.org/package/mstate My first hackage library. :) Awesome. I needed something like that once, too, down to the same type signature for the fork function. Here's an

Re: [Haskell-cafe] MState: A consistent State monad for concurrent applications

2010-07-02 Thread Nils Schweinsberg
On 03.07.2010 03:27, Matthew Gruen wrote: Awesome. I needed something like that once, too, down to the same type signature for the fork function. Here's an instance from my code: instance MonadFork (ReaderT s IO) where fork newT = ask= liftIO . forkIO . runReaderT newT I've added this