[Haskell-cafe] Cloud Haskell real usage example

Thiago Negri evohunz at gmail.com
Thu Aug 23 01:56:34 CEST 2012

| I have pasted a version of your code that uses Template Haskell at
| http://hpaste.org/73520. Where did you get stuck?

Your version worked like a charm. I'm quite new to Haskell, so I was
trying desperately to get TH working: forgot to quote "worker" at

| 1. A bug in the SimpleLocalnet backend meant that if you dropped a
| worker node findSlaves might not return. I have fixed this and
| uploaded it to Hackage as version

Updated to version and it's working now. :-)

| 2. But even with this fix, you will still need to take into account
| that workers may disappear once they have been reported by findSlaves.
| spawn will actually throw an exception if the specified node is
| unreachable (it is debatable whether this is the right behaviour --
| see below).

Added exception catching, thanks.

| Note that with these modifications there is still something slightly
| unfortunate: if you delete a worker, and then restart it *at the same
| port*, the master will not see it. There is a very good reason for
| this: Cloud Haskell guarantees reliable ordered message passing, and
| we want a clear semantics for this (unlike, say, in Erlang, where you
| might send messages M1, M2 and M3 from P to Q, and Q might receive M1,
| M3 but not M2, under certain circumstances). We (developers of Cloud
| Haskell, Simon Peyton-Jones and some others) are still debating over
| what the best approach is here; in the meantime, if you restart a
| worker node, just give a different port number.

I trust you will make a good decision on this.

By the way, my new code with TH and exception catching: http://hpaste.org/73548


More information about the Haskell-Cafe mailing list