3 ms·
($) helps to avoid some parens. The (.) is more common to change functions, and closely related. ($) does not really compose functions, it is function applica
by eru 17y ago
($) helps to avoid some parens. The (.) is more common to change functions, and closely related. ($) does not really compose functions, it is function application and right associative.
Your example would rather read something close to
sort -n . uniq -n . sort . awk '{ print $5}' . grep tcp . netstat -n
(And `$ argument' at the end, if there was one.)
- samstokes 17y ago($) is actually the least interesting operator in the world :) But as you say, its parsing precedence makes it useful (because it lets you skip parens). What I like is how ($) generalises to (<$>) for applicative functors, so you can write succ $ 5 -- -> 6 succ <$> Nothing -- -> Nothing succ <$> Just 5 -- -> Just 6 succ <$> [1, 2, 3] -- -> [2, 3, 4] Who needs "for" loops? :)
- eru 17y agoI agree. Though I'd say id or const or even less interesting than ($).
- eru 17y ago(`to change functions' should have been `to chain functions'.)