by bhargav · 1y ago · 0 comments
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
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] 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). strSum = sum . parsed . words
where
parsed = map read