News for hackers. Stuff that matters.
Re:The Cult of the Haskell Programmer by nequo on Tuesday May 14, 2024 @01:03PM (#40357356)
The reason it looks the way it does is that forM_ is just a function like any other, not a keyword in a dedicated syntactic construct.
Re:The Cult of the Haskell Programmer by karmakurtisaani on Tuesday May 14, 2024 @01:08PM (#40357407)
Yep, and then there's the $, \ and PutStrLn. As a non-Haskell programmer none of those mean anything to me.
Re:The Cult of the Haskell Programmer by nequo on Tuesday May 14, 2024 @01:28PM (#40357668)
$ is short for “put everything to the right inside parentheses” and \x -> y defines an anonymous function.

Why do you expect to understand the syntax of a language you never studied?

Re:The Cult of the Haskell Programmer by karmakurtisaani on Tuesday May 14, 2024 @01:47PM (#40357884)
> $ is short for “put everything to the right inside parentheses”

There's, you know, also the actual parentheses that everyone already knows.

> Why do you expect to understand the syntax of a language you never studied?

Because most languages have a syntax that you can grasp almost immediately, since they conform to a common syntax, rather than invent everything all over again. Then you can focus on the actual features of the language and are not bogged down by syntax.

Re:The Cult of the Haskell Programmer by tasuki on Tuesday May 14, 2024 @03:39PM (#40359264)
You know, perhaps Haskell isn't the right language for you. That's fine. Why should it conform to your syntactic preferences?
Re:The Cult of the Haskell Programmer by nequo on Tuesday May 14, 2024 @02:41PM (#40358591)
It doesn't take more than two minutes to understand what $ and \x -> y do, and if you start writing out those parentheses, you will also realize why $ is part of idiomatic Haskell.
Re:The Cult of the Haskell Programmer by eru on Tuesday May 14, 2024 @07:01PM (#40361129)
> There's, you know, also the actual parentheses that everyone already knows.

Those are also available, and are legal syntax in Haskell.

> Because most languages have a syntax that you can grasp almost immediately, since they conform to a common syntax, rather than invent everything all over again.

I hope you don't count C's `for(something, something; something; something) {` as part of that intuitive bunch?

Btw, Haskell didn't re-invent the wheel for most of its syntax: they stuck to the common and already established syntax of the ML family of languages. ML is from 1973. (For comparison, Wikipedia says C is from 1972.)

Re:The Cult of the Haskell Programmer by karmakurtisaani on Wednesday May 15, 2024 @03:20AM (#40364029)
> Those are also available, and are legal syntax in Haskell.

I don't especially like the idea of making multiple notations for the same thing, to be honest.

> I hope you don't count C's `for(something, something; something; something) {` as part of that intuitive bunch?

Not my favorite, but at least widely used. I find the style in for example Rust the most easy on the eye.

> Btw, Haskell didn't re-invent the wheel for most of its syntax

Yeah I actually suspected this was the case.

Re:The Cult of the Haskell Programmer by eru on Thursday May 16, 2024 @03:27AM (#40376008)
> I don't especially like the idea of making multiple notations for the same thing, to be honest.

I can appreciate that sentiment, but I'm afraid the designers of Haskell had a different approach there.

There often a few different ways to express something. But at least they can often be understood as thin syntactic sugaring of one into the other. It's not like C++ or Perl (or even Ruby with its different types of closures) where you have tons of overlapping ways to express something, and they are all subtly different.

> I find the style in for example Rust the most easy on the eye.

I'm not sure about easy-on-the-eye, but I find Rust mostly quite bearable, too.

Re:The Cult of the Haskell Programmer by tome on Thursday May 16, 2024 @05:06AM (#40376447)
> > I don't especially like the idea of making multiple notations for the same thing, to be honest. > > I can appreciate that sentiment, but I'm afraid the designers of Haskell had a different approach there.

It's also very difficult to achieve in practice. According to the Zen of Python "There should be one-- and preferably only one --obvious way to do it" but I don't think even Python lives up to that.

Re:The Cult of the Haskell Programmer by eru on Saturday May 18, 2024 @11:29PM (#40404024)
Yes, it's only aspirational in Python, too.