1. 21
  1.  

  2. 4

    Using concurrency control tools (channels) to traverse an immutable (or exclusively owned) data structure is using a bazooka to kill a mosquito.

    1. 3

      Ha! A sneaky way to market Haskell :)

      1. 2

        This code speaks to Haskell’s really strength – the ability to author clear, re-useable abstractions. It is only half in jest that Simon Peyton-Jones called Haskell “…the world’s most beautiful imperative language.”.

        The strength of Haskell’s abstracting power can also be a weakness. The author writes:

        …this site exclusively uses the async package and the stm package for concurrency. Concurrency is represented explicitly and used in IO.

        And:

        …in order to make it easier for non-Haskell users, several famous utility functions and excessive point-free style are avoided.

        You can do everything you do in Go in Haskell, in a very similar way; but you can also do it in a totally different way; and it’s hard to say what you’ll see in the wild.

        The fact that Haskell doesn’t bake in try ... catch doesn’t mean you won’t see code with exceptions. For awhile, what it meant was that one saw many similar-but-not-the-same-approaches to this kind of error handling – and anyone could code their own.