News for hackers. Stuff that matters.
Re:Reading Simple Haskell by Tehnix on Saturday December 09, 2017 @09:02AM (#15885822)
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.

Re:Reading Simple Haskell by pjmlp on Saturday December 09, 2017 @10:18AM (#15886133)
Regarding concurrency in Haskell, there is a very good book from Simon Marlow, "Parallel and Concurrent Programming in Haskell".
Re:Reading Simple Haskell by hoprocker on Saturday December 09, 2017 @02:34PM (#15887594)
Agreed -- 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.
Re:Reading Simple Haskell by leshow on Sunday December 10, 2017 @02:10AM (#15890360)
When 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.

Re:Reading Simple Haskell by lalaithion on Sunday December 10, 2017 @03:03AM (#15890491)
One 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

Re:Reading Simple Haskell by leshow on Sunday December 10, 2017 @04:37AM (#15890676)
It's the function type, data (->) a b. It is commonly written in infix notation though.
Re:Reading Simple Haskell by junkscience2017 on Saturday December 09, 2017 @08:28PM (#15889242)
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.
Re:Reading Simple Haskell by Tehnix on Sunday December 10, 2017 @02:16AM (#15890370)
A 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_g...

[1] https://hackage.haskell.org/package/gochan-0.0.2/docs/Contro...

Re:Reading Simple Haskell by bjoli on Saturday December 16, 2017 @07:14AM (#15939208)
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.
Re:Reading Simple Haskell by spraak on Saturday December 09, 2017 @10:07AM (#15886087)
Wow that resource is super clever and useful, I wish it had the full "Tour"!
Re:Reading Simple Haskell by Tehnix on Saturday December 09, 2017 @10:14AM (#15886116)
It 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