Functional programming in Python

Peter Hancock p.g.hancock@swansea.ac.uk
Thu, 24 May 2001 12:08:15 +0100 (BST)


Hi, you said

> Unfortunately in many cases you need to apply nearly as many
> parens for a Haskell expression as you would for a Python one, but 
> they're in different places. It's not:
>
>                 foo( bar( baz( x ) ) )
>         it's:
>                 (foo ( bar (baz x) ) )

Clearly the outer parentheses are unnecessary in the last expression.
One undeniable advantage of (f a) is it saves parentheses.

My feeling is that the f(a) (mathematical) notation works well when
type set or handwritten, but the (f a) (combinatory logic) notation
looks better with non-proportional fonts.

In a way the f(a) notation "represents things better": the f is at a
higher parenthesis level than the a.

Peter Hancock