process with mutable state in haskell

Hello, Can i run process with some mutable state and communicate with it in haskell? Something like gen_server in erlang. Thank you.

2012/12/23 Alexander _
Can i run process with some mutable state and communicate with it in haskell? Something like gen_server in erlang.
There are many ways implement this kind of communication in Haskell, among them. There has been some work done on an Erlang-like library, as well; but it's name escapes me at present. Common tools for shared state management in Haskell include: STM, Chan, MVar and IORef. All these mechanisms allow one Haskell thread to talk to another Haskell thread. (In Haskell programming, we tend to use the term "process" only to refer to an operating system process.) To talk to a thread on another computer -- which necessarily crosses system boundaries -- is not so easy in Haskell. It is, at least, not as transparent as it is in Erlang. (Of course, there are always file handles...) Here is a link to a relatively small program I recently wrote, using STM to buffer input and flush it at a fixed frame rate: https://github.com/solidsnack/shuttercat/blob/master/shuttercat.hs It makes use of just TChan and TVar from the STM package. -- Jason Dusek pgp // solidsnack // C1EBC57DC55144F35460C8DF1FD4C6C1FED18A2B

There is also Cloud Haskell : http://www.haskell.org/haskellwiki/Cloud_Haskell
Cloud Haskell is closer to an Erlang-like on Haskell, though it's
still cutting edge and so not so very stable, it at least is backed by
some very serious name in the Haskell universe so we can hope for good
things.
--
Jedaï
On Sun, Dec 23, 2012 at 5:52 PM, Alexander _
Hello,
Can i run process with some mutable state and communicate with it in haskell? Something like gen_server in erlang.
Thank you.
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (3)
-
Alexander _
-
Chaddaï Fouché
-
Jason Dusek