4 ms·
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,
by Tehnix 9y ago
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 https://a-tour-of-go-in-haskell.syocy.net/en_US/index.html.
- spraak 9y agoWow that resource is super clever and useful, I wish it had the full "Tour"!
- Tehnix 9y agoIt was more or less just posted, but I could imagine there is plans for the rest of the content to be ported also. I might help with that if I get any time during Christmas :x
- pjmlp 9y agoRegarding concurrency in Haskell, there is a very good book from Simon Marlow, "Parallel and Concurrent Programming in Haskell".
- deleted 9y ago[deleted]
- hoprocker 9y agoAgreed -- I found Haskell most confusing at first because of the lack of syntax. My brain kept wondering where the rest of the syntax was. Not to be too dramatic, but I think Haskell is kind of like programming "poetry" in this regard.
- leshow 9y agoWhen I first start I though there was so MUCH syntax, (->), (<*>), (<$>), (>>=), (.), ($), etc I realized pretty early on all these were just functions, that was cool experience for me. Even the types are sort of functions.
- lalaithion 9y agoOne fun thing is how -> is basically just an infix operation that takes two types as arguments and returns a new type. add :: (->) Int Int add x y = x + y
- leshow 9y agoIt's the function type, data (->) a b. It is commonly written in infix notation though.
- junkscience2017 9y agoGo 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.
- Tehnix 9y agoA commenter on /r/haskell[0] noted that there is actually a library that mimics Go Channels a bit closer, called GoChan[1]. That said, I think `async` is the idiomatic choice, so it probably makes more sense to keep it. [0] https://www.reddit.com/r/haskell/comments/7ilhb9/a_tour_of_go_in_haskell/ https://www.reddit.com/r/haskell/comments/7ilhb9/a_tour_of_g... [1] https://hackage.haskell.org/package/gochan-0.0.2/docs/Control-Concurrent-GoChan.html https://hackage.haskell.org/package/gochan-0.0.2/docs/Contro...
- bjoli 9y agoWhich is strange. It should be possible to implement proper CML-style concurrency in Haskell, which is strictly more expressive than the go concurrency model.