4 ms·
Some typical pragmatic applications: 1. Escaping parenthesis hell: sometimes you can escape an unreasonable amount of parenthesis nesting by using (some) point
by rbehrends 10y ago
Some typical pragmatic applications:
1. Escaping parenthesis hell: sometimes you can escape an unreasonable amount of parenthesis nesting by using (some) point-free programming.
2. The same thing that you'd use cascades in Smalltalk for: repeated applications of operations to the same object without having to name the object over and over again. (Obviously, in a functional language, it may not strictly be the "same" object, but conceptually, it's the same pattern.)
3. Combinator libraries (mentioned by the article itself). Here, the functions being composed are really meant to be (mostly) opaque entities and the fact that you're using a form of function composition is an implementation detail.
- coldtea 10y ago>1. Escaping parenthesis hell: sometimes you can escape an unreasonable amount of parenthesis nesting by using (some) point-free programming. Why would I want to? Parenthesis make precedence explicit.
- eru 10y agoParens can be harder to parse for humans than operators. That's the whole point that justifies not going for S-Expression syntax for every programming language in the first place.
- michaelmrose 10y agoIndentation can help but personally I like my editor to color matching parens the same color making it easier to visualize structure.
- eru 10y agoOh, I definitely have a soft-spot for s-expression syntax---especially with good editor support for colours and indentation and syntax-aware editing. It actually took my quite a while to warm-up to Haskell's richer and more complicated syntax.