
On 23.11.2014 18:04, martin wrote:
at my shop some folks are implementing things using a java tool called "activiti". AFAIK, they create a bunch of processes and a "process engine" takes care of activating or deactivating processes. Among the things which can cause a state transition are external events. I wonder how one could do this in haskell.
Like a like a mini operating system: processes and their scheduler? Perhaps take a look at the following: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.39.8039 http://repository.upenn.edu/cgi/viewcontent.cgi?article=1391&context=cis_papers http://www.haskellforall.com/2013/06/from-zero-to-cooperative-threads-in-33....
I suppose I could handle this using threads, but I don't trust threads. They look simple first, but then the trouble they cause typically exceeds my worst expectations. In Erlang you woudn't think much and use (lightweight) processes and message passing. You can do the same in Haskell, just don't use global state, use channels instead.
I also recall https://hackage.haskell.org/package/aivika, discrete event simulation library, but I don't know if it is related. -- Wojtek