News for hackers. Stuff that matters.
Re:Why Haskell? by ColonelPhantom on Thursday September 12, 2024 @03:48PM (#41524742)
I disagree that the 'arcane sigil invocations' are necessarily a problem. Yes, they can be, but I also think they can definitely be preferable!

Naming everything as a function often leads to a problem of very deep visual nesting. For example, map-then-filter can be written as "filter p . map f" in Haskell, whereas in sigil-free languages you'd write a mess like (lambda (x) (filter p (map f x))) in Lisp or "lambda x: filter(p, map(f, x))" in Python.

Of course, function composition is a very simple case, but something like lenses are another less simple case where a library would be unusable without custom operators.

Re:Why Haskell? by kazinator on Thursday September 12, 2024 @05:35PM (#41525832)
Right off the bat, the problem is that filter p . map f looks like it wants to be filter, then map. Nearly all modern languages that have pipelining, whereby nested function calls are extraposed into a linear formm, go left to right.

In the Lisp or Python, it is crystal clear that the entire map expression is a constituent of the filter expression.