Functional programming in Python

Marcin 'Qrczak' Kowalczyk
28 May 2001 16:13:47 GMT

Mon, 28 May 2001 10:23:58 +0100, Malcolm Wallace <> pisze:

> It seems that right-associativity is so intuitive that even the
> person proposing it doesn't get it right.  :-)

And even those who correct them :-)

>> f x (foldr1 f xs)			f x foldr1 f xs
> Wouldn't the rhs actually mean f x (foldr1 (f xs)) in current notation?

No: f (x (foldr1 (f xs)))

Basically Haskell's style uses curried functions, so it's essential
to be able to apply a function to multiple parameters without a number
of nested parentheses.

BTW, before I knew Haskell I exprimented with a syntax in which 'x f'
is the application of 'f' to 'x', and 'x f g' means '(x f) g'. Other
arguments can also be on the right, but in this case with parentheses,
e.g. 'x f (y)' is a function f applied to two arguments.

 __("<  Marcin Kowalczyk *
  ^^                      SYGNATURA ZASTĘPCZA