3 ms·
>Operators are fundamentally unreadable I would suggest that is obviously false. Most languages have operators. Is 4+5 really less readable than plus(4,5)?
by imanaccount247 12y ago
>Operators are fundamentally unreadable
I would suggest that is obviously false. Most languages have operators. Is 4+5 really less readable than plus(4,5)? Haskell does not have very many operators. The fact that people see 3 operators they are not familiar with and decide "this is unreadable because of so many operators" speaks rather poorly of people's desire to learn.
- michaelcampbell 12y agoOr, to quote Rich Hickey; "I can't read German; that doesn't make it unreadable." NB: I know a little German, and almost no Haskell.
- sanderjd 12y agoI think "4+5" is readable because I read it as "four plus five", and that operators become un-readable when you can no longer insert a common descriptive word in their place. The problem in haskell is not the few operators in the prelude that are unfamiliar, but the multitude defined in libraries. In fairness, there are good ways to search the documentation for those operators so at least you aren't stuck googling for line noise.
- imanaccount247 12y agoBut you can insert a common descriptive word in their place. Choosing not to learn what >>= means doesn't make it unreadable or line noise. That is like saying C++ is unreadable line noise because it has all these -> all over the place.
- codygman 12y agogetDirectoryContents "/home/cody" >>= print Bind a function which gets the contents of my system tmp directory to a function which takes anything and returns a monad, then return the evaluated monadic result.