3 ms·
That's because this is a very rough, "top-down" description of the language. If, instead of trying to think of Haskell as an inferior Python--which it definitel
by tikhonj 15y ago
That's because this is a very rough, "top-down" description of the language. If, instead of trying to think of Haskell as an inferior Python--which it definitely isn't--you learned it from fundamentals up, all of the syntax would make much more sense.
It's like math: if you just saw something like a triple integral over a weird region with little fiddly symbols everywhere, it wouldn't make sense. If you learned about them starting with the basics, the logic would be clear and elegant.
The other thing is that all the "do" stuff and 'fish operators" are actually really clever and really high-level abstractions--they are basically a unified language for describing all sorts of computations, not just ones with side effects. For just reading most code, this isn't important; for understanding the elegance of Haskell, it is.
- agentultra 15y agoIf, instead of trying to think of Haskell as an inferior Python--which it definitely isn't--you learned it from fundamentals up, all of the syntax would make much more sense. This is essentially what I took from the article. However, I still agree with the OP. If you are already familiar with the language syntax, grammar, idioms, and so forth then it seems easy and trivial. I find a lot of Haskellers confused as to why anyone finds the language difficult and opaque. Many tutorials and articles are written to convince people that Haskell is easy to learn, I think, because they are familiar with it and desire others to be familiar with it too. Once one is familiar with the language it doesn't matter how dense and difficult it is. The truth is that Haskell is difficult to learn. One does have to start learning from the fundamentals up because the fundamentals of Haskell are so different from everything else that it's difficult to relate to the previous experiences of most people. Contrast this with someone who learned C or some dynamic scripting language like Python from the ground-up.. there are a lot of languages with enough shared grammar and vocabulary out there that they can reach out to them without abandoning their previous notions entirely about how programming is done. Haskell may not exactly ask for one to abandon their notions of computing conceptually but I think it is fair to say that it does ask you to give up all of your previous knowledge of syntax and grammar in order to learn it.
- waqf 15y agoI think there are two different questions here. I agree that the semantics of operators such as >>= is a Good Thing and makes Haskell a Better Language Than The Competition, but I still think that the grammar and syntax (such as the significant whitespace rules, or the fact that <- and -> do totally different things) is poorly chosen. Haskell is as hidebound to the ML school as Perl is to the curly-brace school, and they both suffer for it.