5 ms·
It strikes me that I need to be a mathematician to use Haskell. Especially when someone like Rob Pike makes claims that "I cannot read the syntax of Haskell and
by nickbauman 6y ago
It strikes me that I need to be a mathematician to use Haskell. Especially when someone like Rob Pike makes claims that "I cannot read the syntax of Haskell and understand it."
- KSteffensen 6y agoI think the unreadability is a consequence of libraries defining their own infix operators left and right. E.g. according to hoogle >*< is an operator for three different libraries. Maybe this makes sense once you are very familiar with a library (like for example if you are a library dev), but if you are trying to learn a new library it makes for pretty much unreadable code.
- jgwil2 6y agoOne thing that irks me as someone who has dabbled in Haskell is not knowing how I should pronounce infix operators like <*> or <?> as I'm reading a line to myself.
- johnday 6y ago<star> is pronounced either "ap" or "and" depending on context. For example div <$> (Just 5) <star> (Just 7) Would be pronounced "map div over Just 5 and Just 7".
- whateveracct 6y agoI never read operators in my head, so the answer is "no pronunciation at all" I'd say learning Haskell caused me to read code without using words.
- whateveracct 6y agoThat's because Rob Pike never learned Haskell. Expecting to just look at it and know it because you know other languages is quite frankly silly! You don't need to be a mathematician though. Many Haskellers I've worked with either didn't go to university or went for something else. I only ever learned C before Haskell, for instance.
- irfanka 6y agocoughPythoncough
- johnday 6y agoI promise, you don't need to be a mathematician to use Haskell. If you've written shell scripts before, you understand how Haskell functions calls are written. If you've used `forEach()` in imperative languages then you understand functors. These two things alone are half of the groundwork you need to read basic Haskell code! Of course, the fundamental underpinnings of the language will not appear just from a surface reading of the code, but if you're a person who learns by example then the above two are more than good enough. If you're more of a linear learner then Learn You A Haskell [1] is an excellent, if earnest, introduction to the language. Depending on your confidence level you may be able to skip a decent way in. [1]: http://learnyouahaskell.com/starting-out#ready-set-go http://learnyouahaskell.com/starting-out#ready-set-go
- tylerhou 6y ago> If you've used `forEach()` in imperative languages then you understand functors. You understand a single (or a class of) functor but I don't think it means you understand functors in general. You also definitely don't understand how functors fit into Haskell's type hierarchy — its relation to monoids, monads, etc.
- johnday 6y agoAbsolutely. I'm only saying in relation to the idea of "reading Haskell code", it is possible to understand how they work (at the shallowest level) by analogy to `forEach` and to shell syntax. Shell syntax also doesn't explain important constructs like currying, partial application, etc. But it's good enough that someone can read "boring" haskell code without being intimidated and turned off.
- yakshaving_jgt 6y agoYou don't need to understand the functor of functions in order to be productive in Haskell and use functors generally.
- yakshaving_jgt 6y agoHello. I failed high school maths. I write Haskell every day, professionally.
- deleted 6y ago[deleted]
- apta 6y agoPerhaps that explains how they ended up with a subpar language like golang. I'd recommend reading to someone who has a deep understanding of programming like John Carmack.