3 ms·
($) 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
by 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 ($).