Functional programming in Python
Mon, 28 May 2001 10:23:58 +0100
It seems that right-associativity is so intuitive that even the person
proposing it doesn't get it right. :-) Partial applications are a
> Haskell Non-Haskell
> Left Associative Right Associative
> ------------From Prelude----------------------
> f x (foldr1 f xs) f x foldr1 f xs
Wouldn't the rhs actually mean f x (foldr1 (f xs)) in current notation?
> showChar '[' . shows x . showl xs showChar ' shows x showl xs
Wouldn't the rhs actually mean showChar '[' (shows x (showl xs))
in current notation? This is quite different to the lhs composition.
For these two examples, the correct right-associative expressions,
as far as I can tell, should be:
f x (foldr1 f xs) f x (foldr1 f) xs
showChar '[' . shows x . showl xs showChar '[' . shows x . showl xs