3 ms·
There's not a whole lot of syntax in Haskell, e.g. no special statements for control flow. What may be a little confusing is the infix operators. Haskell lets y
by exDM69 15y ago
There's not a whole lot of syntax in Haskell, e.g. no special statements for control flow. What may be a little confusing is the infix operators. Haskell lets you define your own infix operators (which is a good thing compared to a fixed number of user definable operators, like C++ or Python) and there's a few of them you need to know to be efficient with the language (>>= being the most important, $ and . coming second). Exception: <- is not an infix operator but part of the do notation syntax.
Haskell's syntax is very clean and readable, the examples in this article are probably intentionally a bit confusing or at least artificial.
And besides, when looking at a programming language, syntax is the _last_ thing you should look at. The semantics is what is important, by which I mean function calling conventions (fixed vs. curry vs. varargs), type systems (dynamic vs. static vs. inferred), type of evaluation (strict vs. lazy vs. unification) and so on.
Choosing a programming language based on it's syntax is like choosing a wife based on her looks only.
- o1iver 15y agoI would say that understanding composition (.) come before understanding bind (>>=), as bind is like higher-order composition.