
Distributed Systems in Haskell - philippelh
http://yager.io/Distributed/Distributed.html
======
T-R
Distributed Programming was one of the things flagged "Immature" in State of
the Haskell Ecosystem [1]. Just out of curiosity, was that a motivation behind
the project, or do you have any other thoughts on that post-project?

[1] [https://github.com/Gabriel439/post-
rfc/blob/master/sotu.md#d...](https://github.com/Gabriel439/post-
rfc/blob/master/sotu.md#distributed-programming)

~~~
wyager
It was definitely a factor. When we decided to use Haskell on the first
project, we were mostly just curious how viable it would be for us.

If the current state of Distributed Programming in Haskell is "Immature", then
I can't wait to see "Mature" :)

------
boothead
Excellent write up. One point though: watch out for WriterT and RWST leaking
memory:

[http://stackoverflow.com/questions/25280852/space-leak-in-
pi...](http://stackoverflow.com/questions/25280852/space-leak-in-pipes-with-
rwst)

It's often better to just include the writer part you need in a larder State
type (lenses make this really seamless)/

~~~
tikhonj
That's a good point, but it was also mentioned in the article, with a link to
a useful mailing list thread[1] on the matter.

It seems to be a matter of laziness. If you're writing some small piece of
state like an Int, this can be a real problem. If you're writing out a lazy
data structure like a list (as happens in the article), I think the extra
laziness should be fine or even desired. (I've never used Writer in practice,
so take my comments with a grain of salt!)

[1]:
[http://comments.gmane.org/gmane.comp.lang.haskell.libraries/...](http://comments.gmane.org/gmane.comp.lang.haskell.libraries/18980)

~~~
boothead
It was? I still can't see it...

AFAIR the problem with WriterT was the use of mappend within is always lazy,
regardless of the strictness of the w in WriterT w m a.

------
gnusouth
Did you run into any bugs or strange beahviour in Cloud Haskell? I looked into
using it a while ago and came to the (possibly hasty) conclusion that it's not
stable enough to build a large project on. Thanks!

~~~
wyager
None. It was rock solid; never a hiccup. It's evolving, but it seems quite
well written and correct. As with many Haskell libraries in "beta", it works
perfectly even though it's not finalized.

------
wyager
Author here. Glad to see this on HN! Happy to answer any questions.

~~~
navaati
Shouldn't the type of the monadic serverStep be "Message -> m ()" to match the
type of the explicit "serverStep :: Config -> State -> Message -> (State,
[Message])" ? Aka, serverStep isn't a monadic object, it's a Kleisli arrow.

~~~
wyager
You're right, that's a typo. I even wrote it out correctly later. I'll fix
that. Thanks!

------
selmat
Very interesting structure of explanation. I like your short sumarization
(tl;dr) at beginning and "why?" reasoning. I think i will copy it in my next
book :-)

