[Haskell-cafe] question regarding the $ apply operator

Richard O'Keefe ok at cs.otago.ac.nz
Wed Jul 20 04:19:50 CEST 2011


Polish notation was indeed published in 1920.
However, it relies on knowing the arity of each
symbol.  Put another way, it relies on symbols
*having* definite arities.  Thus if f has 2
arguments, it has 2, not 1.  This does not suit
languages like Haskell at all well.  Worse, as
usually presented, it doesn't handle higher
order functions.  Suppose we wrote
	flip - 3 4
Polish notation doesn't really have the notion
of a subexpression yielding an operator.

One could patch Polish notation by assigning
each symbol a rank as well as an arity, but I'll
leave the details out because (a) I'm not sure it
works very well, and (b) I've never found Polish
notation (forward or reverse) to be even close to
readable.

Apparently the first known use of the parenthesis
symbols () in England is in 1494.  Presumably
mainland Europe was using them before, but not
all that long before.  This was for asides in normal
text.  According to http://jeff560.tripod.com/mathsym.html
the first uses of various kinds of brackets in mathematics
go back to the mid 16th century.  We haven't really had
operator precedence for more than a few hundred years,
or operators, come to that.

So yes, it _is_ true "that people a couple of hundreds of
years ago [could] manage to express [mathematics] without
any parenthes[e]s at all".  What clever notation did they
use?  Words.  Lots of words.  Sometimes heavily abbreviated
words.  Parentheses are *better*.




More information about the Haskell-Cafe mailing list