5 ms·
The “map read” part is what’s off. I think it’s because parens are optional or not required. There are other languages which are functional as well. like the o
by bhargav 2y ago
The “map read” part is what’s off. I think it’s because parens are optional or not required.
There are other languages which are functional as well. like the one in the article and like Elixir where readability is it sacrificed.
I still think readability is atrocious in this language. Sure I can get used to it, but I’d never want to subject myself to that
- instig007 2y agoProblem solved: strSum = sum . parsed . words where parsed = map read
- itishappy 2y agoParenthesis are not really optional, they're just used differently than other languages. Other languages use parenthesis for function application and grouping, in Haskell it's just grouping. wordsPerLine = filter (>0) . map (length . words) . lines Funnily enough, parenthesis are actually optional in Elixir, although it's a warning to use pipe syntax without them. The following is valid in both Haskell and Elixer: length [1,2,3]
- runeks 2y agoWhenever you see something like apply foo bar (lol wat) in Haskell, and it confuses you, simply mentally replace it with apply(foo, bar, lol(wat)) To translate into a more popular syntax (e.g. JavaScript).