> The problem with Haskell is its syntax. Too many arbitrary and traditionless things to memorize. It's curious that the Haskell developers try to one-up the rest of the language space in nearly every other space, but choose such a weird and unhelpful syntax.
I've seen this criticism before, and I don't understand it. The syntax of Haskell is not that big. There are some things a bit funky about it, especially the indent rules, but I don't see what there is to be mystified about.
On the other hand, it does introduce a lot of mind-bending concepts if your background includes imperative programming and no category theory, and that's typically what people find hard to grok. You don't find a pile of "Haskell syntax cheatsheets", you find a bunch of monad tutorials instead.
For me at least, that means exactly what you mention in your other reply below. Even more than weird operators themselves, but the problem for me is that they're hard to vocalize in my mind when reading. In other words, this:
plus any more potentially introduced by any libs, or whatever else. When I see any Haskell code, I feel that I trip on those every time. And among them, especially confusion between: -> => <- -< >>= >>
Yeah, but if the monads were the only problem it would be ok (for me at least). But I'm asked to learn monads while also learning this weird syntax. I'm asked to learn something I don't understand in a syntax I don't understand. It's a bit too much. Like a math lecture in which, aside from the new concepts, the lecturer has decided to replace the traditional symbols (+,-, etc) with his new and equally arbitrary ones (¤, @). Except, of course, that Haskell's syntax is often more arbitrary than its competitors.
Well, I basically went "fuck this" after looking at Haskell for a while, but there's surfaced some links in the comments (thanks, akavel) and they provide some examples:
>>=, >>, >, <$>, <$, <>, $, ., !!, !, <|>, :, ::, \, @, ~, -<, <-, =>, ->
Taken together the syntax makes no effort whatsoever to be self-explanatory. I could handle it if it was the only programming language I would ever use, but in the polyglot world we live in and with my leaky bucket of a long-term memory this is not good enough.
I see what you mean. Most of these are custom operators which happen to be in the stdlib, but I wouldn't say :: or ->, for instance, should feel particularly mysterious with a bit of practice.
There is not really any operator overloading going on. You can implement Monoid for your data structure, but as long as you follow the laws... well, you are implementing operations in the correct way, there is no abuse there, nothing that's surprising and going to bite whoever is reading your code.
But one thing where Haskell errs, in my opinion, is in allowing arbitrary infix operators with random ASCII characters, which library maintainers take as an encouragement to each create their own DSLs which totally makes sense to them and nobody else, but that's not the same thing as saying that Haskell-the-language has a huge syntax. Maybe that's what you mean.
Yeah, have you seen what the Scalaz guys are doing? The operators aren't even ASCII! Apparently, there's something about monads that absolutely requires weird symbols.
I've seen this criticism before, and I don't understand it. The syntax of Haskell is not that big. There are some things a bit funky about it, especially the indent rules, but I don't see what there is to be mystified about.
On the other hand, it does introduce a lot of mind-bending concepts if your background includes imperative programming and no category theory, and that's typically what people find hard to grok. You don't find a pile of "Haskell syntax cheatsheets", you find a bunch of monad tutorials instead.