Live data from Hacker News

Reading Simple Haskell

soupi.github.io

81–82 of 82 posts

Re: Reading Simple Haskell

#81
post #56

Haskell can be very readable and elegant, but what I do find frustrating is when research papers show sample Haskell, but it's not quite Haskell. They just can't seem to resist the urge to replace various operators and types with their own non-alphanumeric symbols, thus making what should be reading simple code into some kind of hieroglyphic translation exercise..

> when research papers show sample Haskell, but it's not quite Haskell

For the most part the code in the research papers actually _is_ valid Haskell, provided you enable the -XUnicodeSyntax extension and include a few extra modules. Haskell 98 permits Unicode symbols and identifiers; the extension covers the handful of symbols which are built in to the language or enabled by other extensions. You can find a full list here: https://downloads.haskell.org/~ghc/latest/docs/html/users_gu...

Personally I prefer Unicode symbols and tend to use them whenever possible. I have some XCompose rules configured to make them easier to type. Unfortunately, I have yet to find a comparable input system for Windows.

Re: Reading Simple Haskell

#82
post #2

Unrelated: I'm obviously quite biased, but I generally like Haskell code for pseudo code like things, because it does away with a lot of syntax specific cruft, and stays close to the math it's usually talking about. Also, readers might be interested in A Tour of Go in Haskell, which is the concurrency chapter of A Tour of Go, but just...in Haskell - https://a-tour-of-go-in-haskell.syocy.net/en_US/index.html .

Go is impoverished compared to Haskell but not when it comes to concurrency. The Haskell analogues for these concurrency primitives seem laborious...and they were even moreso prior to the advent of the `async` library.

Which is strange. It should be possible to implement proper CML-style concurrency in Haskell, which is strictly more expressive than the go concurrency model.
Post reply on HN