3 ms·
> endless operator-obfuscation nonsense a la C++ C++? Ever looked at some "advanced" Haskell code?
by zvrba 11y ago
> endless operator-obfuscation nonsense a la C++
C++? Ever looked at some "advanced" Haskell code?
- maemre 11y agoI don't know why you got downvoted but Haskell also gives excessive freedom for infix operators with adjustable precedence, ability to make up new operators etc. and a lot of libraries use such operators excessively so I think you are right. Come to think of whenever I need to write a PEG or use a not-so-common typeclass I need to open documentation to see what juxtaposition of ascii characters to use where. On the other hand, I think the expressibility outweighs the cognitive overhead in case of infix operators, especially when using relatively common operators (Scala kind-of has a similar feature and I (ab)use it frequently and it is nicer and closer to math when combined with Unicode. Closeness to math is an important feat. when translating academic papers into code or vice versa).
- Roboprog 11y agoThe funny thing is I have seen many more damaging errors caused by operator precedence / grouping, which continue running and doing the wrong thing, than by type mismatch errors, which blow up and stop.
- yyhhsj0521 11y agoThe problem with the code you talk about is that they use libraries that are intended to create a new DSL, instead of fuse into the language itself. Apart from that, there isn't really much problem with Haskell's operators. There are only few in standard library addressing applicative and monad, and the de facto standard Lens library.
- Roboprog 11y agoNope. But thanks for the warning.