Friday, May 08, 2015

[eyrfjqor] In praise of $

The dollar sign operator ($) for function application in Haskell is quite awesome at eliminating levels of parentheses: alpha (beta (gamma (delta epsilon))) = alpha $ beta $ gamma $ delta epsilon.

Some people find Lisp unpleasant because they are allergic to "too many parentheses".  Would Lisp have been more a successful programming language if a dollar sign syntax had been part of the language, a syntactic sugar perhaps akin to quote and comma, from the beginning?  Does Lisp frequently have last-heavy parenthesized expressions which would benefit from dollar signs?  We possibly also want currying.

Seems vaguely related to tail recursion.

Also previously vaguely related: Syntactic fold.

No comments :