
To make the point more explicit. Usually people use actors or agents because they want effect isolation, but in Haskell nothing is going to escape your notice on that front. If you want to expand the scope of what in your codebase is *pure*, thereby relegating side-effects to only the functions that *have* to be side-effecting, then you might consider turning your problem into a Free Monad, where there's a pure DSL and pure functions that manipulate only the DSL with a separate effectful interpreter for execution. New people without a firm grasp of monadic DSLs can sometimes find the concept alien, so it's not something you should feel is obligatory. I would first seek to simply write code that solves your problem in Haskell, maybe with the use of Async, then refine afterward with a couple of tests written. Relevant links: http://www.haskellforall.com/2012/06/you-could-have-invented-free-monads.htm... https://www.fpcomplete.com/user/dolio/many-roads-to-free-monads http://www.haskellforall.com/2012/07/purify-code-using-free-monads.html http://www.haskellforall.com/2012/07/free-monad-transformers.html Cheers, Chris On Thu, Mar 27, 2014 at 2:32 AM, Carter Schonwald < carter.schonwald@gmail.com> wrote:
I'm inclined to agree with Chris, in the shared heap setting, you really should try those other approaches first!
On Thu, Mar 27, 2014 at 2:32 AM, Christopher Allen
wrote: Have you looked at the Async library or Marlow's book?
http://hackage.haskell.org/package/async
http://chimera.labs.oreilly.com/books/1230000000929/
Neither involve actors but I think many Haskellers, myself included, are skeptical of actor/agent systems. I've written a fair bit of Clojure and Scala code and don't much care for the model.
If all you really need is message passing/dispatch, you don't strictly speaking need actors. Channels, messages, and dataflow might very well be enough. Perhaps look into functional reactive programming as well?
Cheers, hope this helps.
--- Chris
On Thu, Mar 27, 2014 at 1:29 AM, james
wrote: Having been introduced to actors by looking at Erlang, I discovered Akka.
It seems that the performance is pretty impressive and I like the model.
There seem to be several basic Actor libraries in Hackage, but they don't seem to be very actively developed.
I'm more interested in the model for programming within a single runtime than I am for distributed systems, but message and dispatch performance definitely is important.
Can anyone share experiences with the different packages? Is any one of them stand-out?
Thanks James
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe